Home / Disaster Recovery / DR patterns / Active-active
DR pattern 5 of 5

Active-active

Both sites serve users all the time. If one site is lost, the other is already carrying live traffic and simply takes the full load. For users, recovery is close to instant.

Data you could loseNear zero
Time to recoverNear zero for users
Runs at DR every dayTwo full sites at ~50% load
Relative cost5 of 5
See it working

What happens in a disaster

This is what runs at each site on a normal day. Press Simulate a disaster to watch the primary site fail and the DR site take over, step by step.

Reference architecture

How the pieces fit together

Scroll sideways to see both sites →
Site ASite BGlobal load balancersplits users across both sitesLoad balancerLoad balancerWeb serversstatelessApp serversstatelessWeb serversstatelessApp serversstatelessSession storereplicated cacheSession storereplicated cacheDatabaseaccepts writesDatabaseaccepts writesFiles and objectsreplicated both waysFiles and objectsreplicated both ways123
Numbered lines show how data moves between the sites. Solid boxes are running, faint boxes are on standby or reduced size, and dashed boxes are switched off or not yet built.
PartWhat it does
1 Session replicationUser sessions are kept in a shared, replicated store rather than on one server, so a user moved to the other site does not have to log in again.
2 Two-way database replicationBoth sites accept writes. This needs a database designed for it, or an application that splits data so each record has one home site.
3 File and object replicationUploaded files and objects are copied in both directions so either site can serve them.
Global load balancerSends each user to a site by location or weight, and stops sending users to a site that fails its health checks.

Active-active is as much an application design as an infrastructure design. Web and application servers must be stateless, every operation must be safe to retry, and the database must cope with writes arriving at two places at once.

In practice, many systems described as active-active run the web and application tiers active-active and keep the database active-passive. That gives most of the benefit with far less risk, and it is often the right choice.

Runbook

How failover works

  1. Health checks for one site fail.
  2. The global load balancer stops sending new users to that site. With DNS-based balancing, short TTLs keep this to seconds or minutes.
  3. The surviving site absorbs the full load, using the headroom it was sized with.
  4. No database promotion is needed if both sites already accept writes.
  5. When the failed site returns, it resynchronises and is added back gradually.

Failback: There is no separate failback. The repaired site catches up on data and the load balancer slowly returns users to it.

Fit

When to use it

  • Large digital channels, SaaS platforms and internet-facing services
  • Applications built or rebuilt as stateless services
  • Organisations with mature operations and automated testing

When it is not enough

  • Existing applications that keep state on the server or cannot be changed
  • Databases that cannot accept writes at two sites safely
  • Teams without the operational maturity to run two live sites
Lessons from the field

What to watch out for

  • Data conflicts. Two users changing the same record at two sites at the same moment must be handled by design, not discovered in production.
  • Headroom. Each site must carry 100% of the load alone. In normal running each is at most half used.
  • Hidden single points. A shared licence server, identity provider or payment gateway at one site quietly breaks the design. Map every dependency.
  • Testing. Regularly drain one site completely during business hours to prove the other can carry everything.
Technology

Typical tools for this pattern

Examples only. We recommend tools based on what you already run, your team's skills and your licences.

LayerCommon choices
TrafficGlobal server load balancing, anycast, cloud global load balancers
Application platformKubernetes clusters at both sites, managed with GitOps
DataDistributed SQL databases (CockroachDB, YugabyteDB), MariaDB Galera, or application-level data partitioning
Sessions and messagingReplicated Redis, Kafka with MirrorMaker 2

Comparing options? See all five patterns side by side in the DR patterns guide, or read what DR really costs.

Not sure where your DR stands?

Send us your application list and a short note on how backups work today. We will come back with a plain gap review: which systems are exposed, what a realistic recovery time looks like, and what it would take to close the gap.