Video in progress
A service has to run in two regions. How do you choose between active-passive and active-active?
Active-passive is simple: writes go to one region, the other stands by as a replica for failover, but a failover can lose data and cause minutes of downtime. Active-active writes in both regions — better latency and availability, but far more write conflicts and complexity.
📖 Answer
First I ask two questions: how much downtime (RTO) and how much data loss (RPO) can the business tolerate? And where are the users geographically? In most cases the answer leads to active-passive, because active-active costs more than people expect.
Active-passive. All writes are in region A, with asynchronous replication to region B. The application in B is also running (warm standby) or in a minimal state.
- Failover: switch DNS or the global LB to B, and promote the replica in B to primary. Usually 5–30 minutes, less if automated.
- RPO = the replication lag (seconds).
- Risk: if the failover has never been tested, it won't work when you need it. You need a real switchover drill at least once or twice a year.
Active-active. Both regions write.
- Changing the same record in two regions at the same time is a conflict. Ways to resolve it: "last write wins" (data is lost), CRDTs (for counters and sets), or the most practical — split the data by ownership: each user has a "home region" and their writes are executed only there. The other region only reads their data or routes the request to the home region.
- Global uniqueness (one email, one username) isn't guaranteed without cross-region coordination.
- Globally consistent databases (Spanner, CockroachDB) solve this, but every write costs a cross-region round trip (50–150 ms).
My decision rule:
- Financial, inventory, booking — need strong consistency: active-passive, or active-active split by home region.
- Content, profile, feed — conflict-tolerant: active-active makes sense.
- If it's mostly read load — active-passive plus a read replica and cache in region B is often enough.
And in both cases don't forget the dependencies: Kafka, Redis, secrets, configuration and the IP whitelists of external providers must be ready in the second region too. Many failovers fail on exactly these "small" things.
Sign up to mark studied questions and save your progress.