Updated 24 October 2026
Active-active vs active-passive
High-availability topologies compared: active-passive with hot, warm and cold standbys, active-active within and across regions, failover detection and promotion, split brain and fencing, write conflicts, RTO and RPO, cost, and how to choose for databases, services and whole regions.
Try it yourself, in a playground:Vector clocksRead-your-writes consistencyCAP theoremDatabase failover, RPO and RTOCRDTsBackups and recoveryMulti-region databases
To survive failures, you run more than one copy of everything. The question is whether the copies all serve traffic at once (active-active) or one serves while the others wait (active-passive). The choice shapes failover speed, data consistency, cost and complexity, and it applies at every level: a database, a service, or an entire region. Interviewers ask "what happens when this fails?"; your answer usually names one of these topologies.
Active-passive
One primary handles all traffic; one or more standbys receive replicated data and take over if the primary fails.
Standby temperature:
- Hot standby: running, fully replicated, ready to take over in seconds to a minute.
- Warm standby: running at reduced capacity, needs scaling up before taking full load; minutes.
- Cold standby: infrastructure defined but not running; restore from backups; hours.
Properties:
- Simple consistency: one writer, so no write conflicts.
- Wasted capacity: standbys mostly sit idle (though hot database standbys can often serve reads).
- Failover is an event: detection, promotion, and redirecting traffic take time, and failover paths that are rarely exercised tend to break when needed.
Typical: relational database primary with a synchronous or asynchronous replica in another zone; a disaster-recovery region for less critical systems.
Active-active
All copies serve traffic simultaneously; load balancers or DNS spread users across them.
Properties:
- No idle capacity, and failover is just "stop sending traffic to the failed copy", usually fast and well tested because the path is used constantly.
- Each copy must have headroom to absorb the others' traffic when one fails.
- For stateless services, active-active is the default and easy.
- For data, it is hard: if two copies accept writes to the same record, they can conflict.
Writes in active-active
Ways to handle writes when several sites are active:
| Approach | How | Trade-off |
|---|---|---|
| Partition ownership (home region) | each user or record is written in one region only; others forward or read replicas | no conflicts; cross-region writes for travelling users |
| Consensus across sites | writes commit on a majority of regions | strong consistency; cross-region latency per write |
| Multi-leader with conflict resolution | any region accepts writes; replicate asynchronously and resolve conflicts | low latency; last-writer-wins loses data, merges need design |
| CRDTs | data types that merge automatically | only for data that fits those types |
See multi-region architecture, Spanner and distributed SQL and CRDTs vs operational transformation.
Failover mechanics
- Detection: health checks and failure detectors; require several failures to avoid flapping. See gossip and failure detection.
- Promotion: choose the most up-to-date standby; with consensus-based systems this is automatic.
- Fencing: ensure the old primary cannot keep accepting writes (revoke its lease, block it at the network, use epoch numbers), or you get split brain: two primaries diverging. See distributed locks and leases.
- Redirect traffic: update the endpoint, DNS or load balancer; clients reconnect. See global traffic management.
RTO and RPO
- RTO (recovery time objective): how long until service is back.
- RPO (recovery point objective): how much recent data you can lose.
| Topology | Typical RTO | Typical RPO |
|---|---|---|
| Cold standby from backups | hours | since the last backup |
| Warm standby, async replication | minutes | seconds of writes |
| Hot standby, async replication | under a minute | seconds |
| Hot standby, synchronous replication | under a minute | zero |
| Active-active with consensus | seconds | zero |
Synchronous replication gives zero data loss at the cost of write latency, which is why it is usually done within a region (across zones) rather than across continents. See backups and disaster recovery.
Cost
Active-passive across regions doubles infrastructure for little daily use; active-active uses everything but requires each site to have spare capacity (with three active regions, each must handle half the total load if one fails) and much more engineering for data. See cost-aware system design.
Choosing
- Stateless services: active-active across zones always; across regions when latency or availability goals justify it.
- Relational databases: active-passive with a hot synchronous standby in another zone; asynchronous replica in another region for disaster recovery.
- Global, read-heavy systems: active-active reads everywhere, writes to a home region. See Design a URL Shortener.
- Money and inventory: single-writer per record (home region or consensus), never last-writer-wins. See Design a Payment System.
- Chat and social: users homed to a region, active-active overall. See Design WhatsApp.
In the interview
"Application servers are active-active across three zones. The database is active-passive with a synchronous standby in another zone, giving sub-minute failover and no data loss; fencing prevents split brain. A warm standby region with asynchronous replication covers regional disasters with an RPO of seconds." For a key-value store, explain how replicas share writes (quorums or consensus) instead.
Checklist
- Topology chosen per component: services, databases, regions.
- Standby temperature matched to RTO.
- Write strategy for active-active data: ownership, consensus, or resolved conflicts.
- Detection, promotion, fencing and traffic redirection planned and practised.
- RTO and RPO stated; synchronous replication where RPO must be zero.
- Capacity headroom to absorb a failed site.
Questions people ask
What is the difference between active-active and active-passive?
In active-active, all copies serve traffic at once; in active-passive, one primary serves all traffic while standbys receive replicated data and wait to take over. Active-passive keeps consistency simple because there is one writer, but standbys mostly sit idle and failover is an event that takes time. Active-active has no idle capacity and fails over by simply stopping traffic to the failed copy, but data is hard, because two copies accepting writes to the same record can conflict.
What is an active-active architecture?
An active-active architecture runs several copies that all serve traffic simultaneously, with load balancers or DNS spreading users across them. Failover is just stopping traffic to the failed copy, which is usually fast and well tested because the path is used constantly. Each copy needs headroom to absorb the others' traffic: with three active regions, each must handle half the total load if one fails. It is easy for stateless services and hard for data, where writes can conflict.
What is an active-passive architecture?
An active-passive architecture has one primary that handles all traffic and one or more standbys that receive replicated data and take over if the primary fails. A hot standby is ready in seconds to a minute, a warm standby runs at reduced capacity and needs minutes to scale up, and a cold standby is restored from backups over hours. With a single writer there are no write conflicts, but the standbys mostly sit idle.
Should you use active-active or active-passive?
Choose per component rather than once for the whole system. Stateless services run active-active across zones, while relational databases run active-passive with a hot synchronous standby in another zone and an asynchronous replica in another region for disaster recovery. Global, read-heavy systems serve reads active-active everywhere and send writes to a home region. Money and inventory need a single writer per record, through a home region or consensus, and never last-writer-wins.
How do writes work in an active-active database?
Active-active systems handle writes with home-region ownership, consensus across sites, multi-leader replication with conflict resolution, or CRDTs. Home-region ownership writes each user or record in one region only, so there are no conflicts, though travelling users make cross-region writes. Consensus gives strong consistency at the cost of cross-region latency per write; multi-leader keeps latency low, but last-writer-wins loses data; CRDTs merge automatically but only fit certain data types.
What are RTO and RPO in failover?
RTO (recovery time objective) is how long until service is back, and RPO (recovery point objective) is how much recent data you can lose. A cold standby restored from backups has an RTO of hours, a hot standby has an RTO under a minute, and active-active with consensus recovers in seconds with an RPO of zero. Synchronous replication gives zero data loss at the cost of write latency, so it is usually done across zones within a region.