Skip to content

Multi-region and Disaster Recovery

advanced · 30 min · Last reviewed 31 Oct 2026 · by TheLearningLoop Team

Key takeaways

  • Choose a recovery pattern from the RTO (how long you can be down) and RPO (how much data you can lose), because lower numbers cost more.
  • Replication copies mistakes as well as good data, so you still need separate, tested backups and point-in-time recovery.
  • A failover plan that is never practised usually fails. Rehearse failover and fail-back, and keep the failover tools outside the region that can fail.

Why you need multi-region and disaster recovery, and when to use them

A data centre can lose power, a cloud region can have an outage, a bad deployment can delete data, and a flood can destroy a building. Disaster recovery (DR) is the plan to bring the service back after such an event. A multi-region design runs the service in more than one geographic region so one region's failure does not stop it.

It gives you two things interviewers always ask about:

  • Availability: users keep getting service, or get it back quickly, when a whole region fails.
  • Durability and latency: data survives the loss of a region, and users near each region get faster responses.

Two numbers define the target:

  • RTO (recovery time objective): how long you can be down.
  • RPO (recovery point objective): how much recent data you can afford to lose, measured in time.

RTO is counted from the moment the service breaks, so it includes the time to notice the failure and decide to act, not only the time to switch over. The minutes and hours in this lesson are illustrative round numbers, not measurements of any real system.

Use multi-region when:

  • The cost of a regional outage is higher than the cost of the extra regions.
  • You have users around the world and need low latency near each.
  • Rules require data to stay within a country or region.

Keep it simple (one region plus backups) when:

  • The business can tolerate hours of downtime.
  • The service is small, and the extra complexity would cause more outages than it prevents.

Try it

A region fails, or a bug deletes data. Compare three setups.

Multi-region and Disaster Recovery

Step 1 of 4 · Press Space to play, arrow keys to step

Normal operation

Region AservingRegion Bstandby, copyingBackupsnightly

newest is 10 hours old

Initial state. Region A serves everyone and copies its writes to a standby Region B, a little behind.

tick:
0
downtime (minutes):
0
data lost (minutes of writes):
0

1 tick = one step of the simulation.

Things to try:

  • Run One region + nightly backup with Region A goes down. Recovery takes hours and loses hours of data.
  • Switch to Active-passive, then Active-active, and compare downtime and data lost.
  • Choose A bug deletes data with each setup. Notice that replication copies the mistake.

What to watch: the two counters are the RTO ("downtime") and the RPO ("data lost"). The simulation assumes the newest nightly backup is 10 hours old, a restore takes 4 hours, the standby is 1 minute behind and a failover takes 10 minutes. These are illustrative assumptions. Active-active shows 0 minutes of downtime as a simplification: in a real system, clients with cached DNS answers and requests in flight would still see a short disruption. A bad delete shows the same loss for every setup because the simulation has no point-in-time recovery, which would cut that loss to a few minutes.

Disaster recovery patterns

PatternHow it worksRTO and RPOCost and weakness
Backup and restoreCopy data elsewhere regularly. Rebuild after a disasterHours, hoursCheapest, slowest
Pilot lightA minimal copy of the system keeps running, scaled up on demandUnder an hour, minutesLow cost, needs a tested scale-up
Warm standby (active-passive)A reduced copy runs and receives replicated dataMinutes, seconds to minutesPays for idle capacity, failover must be practised
Active-activeSeveral regions serve users at the same timeNear zeroHighest cost, conflicts to resolve, harder to build

Active-passive vs active-active

  • Active-passive: one region serves all traffic. A standby region receives copies of the data and takes over on failure. Failover is a deliberate step (promote the standby, move traffic), so there is a short outage, and writes not yet copied are lost.
  • Active-active: both regions serve users, so a failure is a traffic shift and users barely notice. The hard part is data: writes in two regions can conflict, so you need partitioning by user, conflict resolution, or a database that handles multi-region writes.
  • Capacity: a failover only helps if the surviving region can carry the load. With two active regions, each must be able to take all the traffic, so each runs at most about half full. With three regions, each can run at about two thirds full, because the two survivors then carry 1.5 times a normal share (1.5 x 2/3 = 1). A warm standby or pilot light must be able to scale up fast, which means having quota and capacity reserved in advance, since many customers may ask for the same capacity during a regional disaster. (Utilisation figures are simple arithmetic, not a vendor guarantee.)

Synchronous or asynchronous copying

How the data reaches the second region decides the RPO.

  • Asynchronous: the primary confirms a write to the user first and copies it afterwards. Writes are fast, but anything not yet copied when the region fails is lost, so the RPO equals the replication lag.
  • Synchronous: the primary waits for the other region to confirm before it confirms to the user. The RPO is close to zero, but every write pays a cross-region round trip (tens to a couple of hundred milliseconds, depending on distance), and if the other region is unreachable, writes may have to stall or the system must fall back to asynchronous copying.
  • Consensus databases (see consensus and coordination) wait for a majority of replicas, so, with replicas in at least three regions, they survive one region failing without losing confirmed writes, at the same write-latency cost.

This is the consistency-versus-latency trade-off from CAP theorem and consistency, applied across regions. The simulation above models asynchronous copying.

How a failover works

  1. Detect: health checks from outside the region decide the region is unhealthy. Avoid flapping by requiring several failures.
  2. Decide: automatic for clear failures, a person for ambiguous ones, since a wrong failover can cause split brain. Split brain means two regions both believe they are the primary and both accept writes, so their data diverges and must be reconciled later.
  3. Promote the data: the standby database becomes the primary. Replication lag decides how much recent data is missing.
  4. Move traffic: change DNS records, anycast (one address announced from several regions, so the network sends users to a nearby healthy one) or a global load balancer. Keep DNS time-to-live short, and remember some clients cache.
  5. Fail back: after the primary region recovers, resynchronise data and return traffic deliberately, not by accident.
  6. Practise: run regular game days (planned drills in which you fail a region on purpose). An untested plan usually fails when needed.

Backups still matter

Replication copies every change, including mistakes and corruption. A deleted table is deleted in all regions within seconds. Only backups and point-in-time recovery protect against that. Keep backups in another account or region, protect them from deletion, and test restores.

Multi-region design vs the alternatives

ConcernMulti-region active-activeWarm standbyOne region + backups
Survives a region failureYes, with little or no downtimeYes, with a short outageYes, after hours
Data lost on failureSmall, with conflictsSmallHours
Protects against bad deletesOnly with backupsOnly with backupsWith backups
CostHighestMediumLowest
ComplexityHighestMediumLowest
Best forGlobal, critical servicesImportant servicesEverything else

Choose the cheapest pattern that meets the RTO and RPO the business actually needs.

Avoiding a new single point of failure

  • Failover tooling: the thing that moves traffic must not live only in the region that fails. Run it elsewhere.
  • DNS and global load balancing: use a provider that is separate from your region.
  • Secrets and configuration: replicate them too, or the standby cannot start.
  • Dependencies: a shared service in one region (a payment provider, an identity service) can tie all regions to one failure.
  • Data residency: if law keeps data in a country, the standby region must be inside the allowed area too, or the recovery plan itself breaks the rule.

You accept higher cost and complexity for resilience, and a risk of mistakes during failover.

Common mistakes

  • Replication mistaken for backup. Mistakes replicate.
  • Untested failover. The plan fails on the day.
  • Forgetting dependencies. The service is up, but sign-in or payments live in the failed region.
  • Long DNS caching. Traffic keeps going to the dead region.
  • Active-active without a conflict plan. Two regions edit the same record.
  • No fail-back plan. Returning is as risky as leaving.

How to talk about multi-region and DR in an interview

  • Ask for the RTO and RPO, and what a regional outage costs.
  • Pick a pattern to match: backup and restore, warm standby, or active-active, and explain the data part (replication lag and conflicts).
  • Mention backups and point-in-time recovery for human error, health checks, DNS or global load balancing, and regular failover drills.
  • Name the trade-off: lower RTO and RPO cost more money and complexity.
  • Say whether the copy is synchronous or asynchronous (RPO against write latency), and check that the surviving region has the capacity to take the full load.

Where you meet multi-region and disaster recovery in real systems

Payment systems, streaming services and cloud providers all plan for the loss of a region. Here are three drawn out, the first with commands you can run, then more examples.

Example 1: A replica, a promotion and a backup

Redis replication shows a standby following a primary and being promoted. PostgreSQL's dump and restore show a backup you can rebuild from. Open the example below to see the picture and the commands.

Config: a replica to promote and a backup to restoreSetup a few commandsCode no code changes
Primary serveswrites replicateRegion failshealth checks tripPromote standbybecomes primaryMove trafficDNS or load balancer
The standby copies the primary's writes a little behind. On failure it is promoted and traffic moves to it. Writes not yet copied are the data loss.
# Run on the standby (the replica). Replace the host and port with your primary's address.

# Start following the primary. It copies the data, then streams new writes.
REPLICAOF primary.example.com 6379

# Check the link: role, link status and how far behind the replica is.
INFO replication

# On failure, promote the standby to primary. It stops following and accepts writes.
REPLICAOF NO ONE

The Redis commands were run against two real Redis 7 servers: the replica followed the primary, reported its link status, and accepted writes after promotion. The PostgreSQL commands were run against a real PostgreSQL 16 server: a dump was restored into a new database and the data matched. Hosts and names are examples.

Two cautions when you read these results. First, the restore time you measure is the largest part of the RTO for backup and restore, but the RTO also includes the time to notice the failure and decide to restore. Second, a dump is a snapshot from one moment, so the data lost is everything written after the dump started, and a logical dump is not point-in-time recovery (for that, archive the write-ahead log, listed under tools below). Redis replication is also asynchronous by default, so writes the primary had confirmed but not yet sent to the replica are lost on promotion.

Example 2: Active-passive regions

Region A serves everyone and copies its data to Region B. A global load balancer moves traffic if A fails.

UsersGlobal LBRegion ARegion BBackups
Users reach Region A through a global load balancer. Region A copies data to Region B. If A fails, the load balancer sends traffic to B, which is promoted.

Example 3: RTO and RPO on a timeline

Recovery time is the gap in service. Recovery point is the data you lose. In the rows below, the first cell is the recovery time and the second is the recovery point. The values are illustrative orders of magnitude, not measurements.

Backup + restorehourshoursWarm standbyminutessecondsActive-active~0~0
Backup and restore loses hours of data and takes hours to recover. A warm standby loses seconds or minutes and recovers in minutes. Active-active has almost none of either.

More real-world scenarios

Scenarios 4 to 10 are common patterns described in general terms, not claims about a named company. Check a vendor's own documentation for its actual numbers.

4. Banks and payments

Payments must not be lost, so writes are copied to a second site before they are confirmed, accepting some latency.

5. Global streaming

Videos are served from caches in every region, so the loss of one region reroutes viewers with little effect.

6. SaaS products

Customer data lives in a home region for law and latency, with a standby in a nearby region.

7. Government and healthcare

Rules demand tested recovery plans, regular drills, and offline copies of critical data.

8. Gaming

Players connect to the nearest region for low latency, and each match lives in one region to avoid cross-region conflicts.

9. Ransomware recovery

Immutable, offline backups allow a clean restore, since replication would copy the encrypted data too.

10. Cloud provider outages

Companies that depend on one cloud region learn to keep a second region, or a second provider, for the critical path only.

Tools and managed services

KindNameNotes
Global trafficAmazon Route 53, Cloudflare, Google Cloud Load BalancingDNS and global load balancing with health checks
DatabasesPostgreSQL streaming replication, Redis replication, Amazon Aurora Global DatabaseCopy data between regions
Backupspg_dump, WAL archiving, managed point-in-time recoveryRestore to a chosen moment
Multi-region databasesGoogle Spanner, Amazon DynamoDB global tables, CockroachDBReplicated across regions. Spanner and CockroachDB use consensus, so a write waits for a majority of replicas and pays cross-region latency. DynamoDB global tables accept writes in every region and, in the default mode, resolve conflicts with last writer wins, so concurrent edits to one item can overwrite each other
PracticeGame days, chaos testing toolsRehearse failover

The takeaway

Whenever a design must survive losing a whole region, decide the RTO and RPO first, copy data to another region, keep separate backups against mistakes, and practise the failover.

Interview questions

Try answering out loud before you reveal hints. Interviewers care about how you reason, not just the final answer.

  1. 1.

    What are RTO and RPO, and how do they decide the design?

    easy
  2. 2.

    What makes active-active hard, and how would you handle it?

    hard
  3. 3.

    Your data is replicated to another region. Do you still need backups?

    medium
  4. 4.

    Walk through what happens when the primary region fails in an active-passive setup.

    medium
  5. 5.

    How do you know your disaster recovery plan will work?

    medium
  6. 6.

    Should cross-region replication be synchronous or asynchronous?

    hard
  7. 7.

    Does having a second region guarantee you survive losing the first?

    medium

Finished this lesson?

Progress is saved on this device. Create a free account to keep it everywhere.

Topics:Disaster recoveryMulti regionRtoRpoFailoverActive activeBackupHigh availability

↑ Back to top

Next lesson