Multi-Region Active-Active Architecture
Serving live traffic from several regions at once: how users are routed, where writes go, how conflicting writes are resolved, and what a region failure costs.
Overview
A multi-region active-active system runs its full stack in two or more cloud regions, and every region serves real users at the same time. If one region fails, the others keep serving; users far apart each get a nearby region.
It is the most available and the most expensive way to run a service. AWS's disaster recovery guidance describes four strategies of rising cost and complexity (backup and restore, pilot light, warm standby, and multi-site active/active) and calls the last one the most complex and costly, able to bring recovery time close to zero with the right design.
The hard part is not the servers; it is the data. Reads can be served anywhere from a copy. Writes are different: if two regions both accept writes, they can change the same record at the same moment, and a region can fail holding writes the others have not seen yet. Every active-active design is really a decision about where writes go and what happens when they collide.
What you will be able to do
- Place a design on the ladder from backup and restore to active-active, using RTO and RPO.
- Route users to regions and away from a failed one.
- Choose between write global, write local and write partitioned, and explain the cost of each.
- Resolve concurrent writes with last writer wins, merges or strong consistency, and say what each loses.
Key concepts
- Active-active vs active-passive
- RTO and RPO
- Latency and geo routing
- Anycast
- Write global, local, partitioned
- Home region
- Last writer wins
- Merge and CRDTs
- Multi-region strong consistency
- Failover capacity
Interview questions
- Design a service to run active-active in two regions. Where do writes go?
- What is the difference between RTO and RPO, and how do they differ for active-active and active-passive?
- Two regions update the same record at the same time. What happens?
- Why do multi-region strongly consistent databases want three regions?
- How do you route users to regions, and what goes wrong during failover?
- Is last writer wins good enough?
- Does active-active replace backups?
Sign up free to read the full topic
More System Design topics
Start free on Cariara · Coding problems · System design studio