Stage 6 · Architecture at scale · Hard · 20 min

Multi-region architecture and disaster recovery

Survive the loss of a whole region. Set an RPO and an RTO, pick a standby from backups to active-active, and see how failover works and what it costs.

What each interview level is expected to know

Learn first: Replication and sharding, CAP, PACELC and quorums, Observability, SLOs and error budgets

After this lesson you can:

  • Set an RPO and an RTO for each kind of data.
  • Compare backups, a standby and active-active by cost and recovery time.
  • Plan a failover that fences the old region and does not overload the new one.

Start here

See it in 60 seconds

When a whole region fails

When the main region fails, the copy elsewhere takes over; how far behind it was decides the writes lost, and detection decides the time down.

Scene 1 of 6 · One region serves

All writes go to US East, and EU West keeps a copy, ready to take over.

UsersUsersUS EastUS EastprimaryEU WestEU Weststandby
  • Users — healthy
  • US East — healthy — primary
  • EU West — healthy — standby
Confirmed writes lost
not shown yet
RTO, in seconds
not shown yet
  1. One region serves. All writes go to US East, and EU West keeps a copy, ready to take over.
  2. Copies arrive later. In the lab's sped-up settings, copying is asynchronous and EU West runs about 500 ms behind.
  3. US East fails. Then US East goes down, taking with it every write that had not been copied yet.
  4. Writes lost: the RPO. Say 1,000 writes arrive a second: being 500 ms behind loses about 500 of them.
  5. Time down: the RTO. Health checks notice after 3 s, and cached DNS answers expire 5 s later: about 8 s down.
  6. Pay to shrink them. Real failovers often take minutes; here the warm standby needs 8 s more: 16 s in all.
  7. Now you try. How far behind US East is the copy in EU West when it fails? For example: 1,000 ms behind, at 1,000 writes a second, loses about 1,000 confirmed writes when US East fails. Those users were told their writes were saved, so data like payments often needs synchronous copies.

Scene 1 of 6: One region serves. All writes go to US East, and EU West keeps a copy, ready to take over.

Key points

  1. The RPO is how much recent data a failure may lose; replication lag sets it.
  2. The RTO is how long users are down: noticing the failure, moving traffic, and scaling up.
  3. Synchronous copies lose nothing but make every write wait for the far region.
  4. A standby that is already fully running takes over faster, but costs more every day.

Go deeper in the Multi-region & disaster recovery lab →

In plain words

Say all writes go to a region called US East, and a second region, EU West, keeps a copy that runs 500 ms behind. US East fails while 1,000 writes arrive each second. The last 500 writes were confirmed to users but not yet copied, so they are lost. Health checks notice the failure after 3 seconds. Users' devices keep the old address for 5 more seconds, so users are down for about 8 seconds. Two targets describe a plan like this. The (RPO) is the amount of recent data you accept losing, measured in time. The (RTO) is how long the system may be down. This setup meets an RPO of half a second and an RTO of 8 seconds. Those times come from a sped-up lab, and a real often takes minutes.

Plans differ in how ready the second region is. The cheapest keeps backups there and rebuilds after a failure, which can take hours. A dearer plan keeps the second region running, standing by or serving users all the time, so it takes over in minutes or less. Copying each write to the second region before confirming it means no confirmed write is lost, but every write then waits for that trip.

The problem it solves

Regions do fail: a power cut, a network fault, a bad deploy or a problem at the cloud provider. With one region, the service is down until that region recovers. Data that was not copied anywhere else can be lost for good. A copy in a second region fixes that, and raises two new questions. How far behind is the copy? And how do you move users to it without breaking more?

Why it matters

A cloud region is a group of data centres in one area, such as US East. A whole region can fail, and then every server in it is out of reach. A system that runs in one region stays down until that region comes back. Planning for this means choosing how much data you may lose and how long you may be down. Each step toward less loss and less downtime costs more, so the choice belongs to the business as much as to the engineers.

A worked example

Say US East takes 1,000 writes a second, and its copy in EU West runs 500 ms behind. If US East fails, about 1,000 × 0.5 = 500 confirmed writes are lost: an RPO of half a second. Health checks notice after 3 seconds, and cached answers last 5 more, so users are down for 3 + 5 = 8 seconds. The warm standby then needs 8 more seconds to reach full size: 16 seconds in all. These are the lab's sped-up times, and a real failover often takes minutes.

Think of it like…

Think of a photo album at home, with copies of your pictures sent to a cousin across town now and then. If the album is destroyed, the pictures not yet copied are gone. You have none at all until you fetch the cousin's copy.

Where this analogy stops working

What you lose and how long you wait are the two useful parts: RPO and RTO. But you know when your album is gone. A system has to decide that a region is down, and a slow region looks much the same. Switch too early, and both regions take writes.

Try it

See it working

Live simulationOpen the full lab →

Lab · Architecture at scale

Multi-region & disaster recovery

Users in the US and Europe, a region on each side. Choose one region, active-passive or active-active. Then fail a region or cut the link between them. Measure latency, downtime (RTO), lost writes (RPO), conflicts and the cost of the standby.

Try it

Lab time 3.0 s
US East regionEU West regionasync copywrites forwardedUS users, → US EastUS users→ US Eastp50 35 msEU users, → EU WestEU users→ EU Westp50 35 msUS East, primary · takes writesUS Eastprimary · takes writes100% capacityEU West, standby replicaEU Weststandby replica50% capacityWitness, third site · votes on failoverWitnessthird site · votes…
  • US users — → US East — healthy — p50 35 ms
  • EU users — → EU West — healthy — p50 35 ms
  • US East — primary · takes writes — healthy — 100% capacity
  • EU West — standby replica — healthy — 50% capacity
  • Witness — third site · votes on failover — healthy
  • Request/response
  • Replication link
  • Read
  • Write
  • Copied change
Availability
100.0%
requests that succeeded
Write outage
0 ms
longest, as users saw it (RTO)
Lost writes
0
acknowledged, now missing (RPO)
US
35 ms
EU
35 ms
Write
125 ms
Stale reads
0
reads served by the nearby region
Conflicts
0
Shed
0
writes refused: over capacity
Split brain
0 ms
time with two primaries
Standby cost
50%
of a full region (illustrative)

Numbers add up:requests 38 = succeeded 38 + failed 0 + in flight 0; no region holds a write its origin never madeThe lab checks this sum as it runs, so a counting mistake would show here.

Controls

Architecture
Regions

US East takes all writes; EU West is a standby replica that can be promoted.

Replication to the standby

Acknowledge first, copy later. Fast writes; a failover can lose recent writes.

Standby size

Half the fleet runs. Moderate cost; short scale-up.

Changing these restarts the simulation.

Traffic & data
6/s
500 ms
Failover
5.0 s

Matters only when a region fails: each user keeps going to the failed region until their saved address runs out.

Failures

Click a region in the diagram to fail or recover it.

Availability (% of requests succeeding)
02550751001s2s3s
Show data table
TimeAvailability
1s100
1s100
2s100
2s100
3s100
3s100
Lost writes (acknowledged, now missing)
00.30.50.811s2s3s
Show data table
TimeMissing
1s0
1s0
2s0
2s0
3s0
3s0
Write latency (ms)
0501001502001s2s3s
Show data table
Timep99
1s125
1s125
2s125
2s125
3s125
3s125

What just happened

Nothing yet. Start traffic or run an experiment.

What this model simplifies
  • Two regions and one database per region. Round trips are fixed: 30 ms to a nearby region, 100 ms across the ocean, 90 ms between regions.
  • Every piece of data is a counter, so "lost" is exact. Real data (profiles, orders) usually cannot be merged and needs a single home region per record or application-level reconciliation.
  • Health checks notice a dead region after a fixed time; DNS repointing is modelled as each user honouring the TTL exactly. Real clients and resolvers often cache longer.
  • When split brain heals, the newer primary wins automatically. Real systems fence the old primary (epochs, lease revocation) and often need manual reconciliation.
  • Capacity limits only writes, and scale-up is a fixed delay. Standby cost is a rough share of a full region, not a price.
  • There is no failback: a recovered primary stays a replica until you change roles.

Also try: Replication · CAP & consistency

Mechanics

How it works

  1. Set an RPO and an RTO for each kind of data

    Ask what each kind of data is worth. A payment may need an RPO near zero, because a lost payment costs money and trust. A page-view count for a weekly report can lose an hour and nobody is hurt. So one system can hold several plans: a strict one for payments and a cheap one for reports.

  2. Choose how much to keep running

    Backup and restore keeps only backups in the second region, and rebuilds the system there after a failure. keeps the data copied all the time, with few or no servers running. A warm standby runs a smaller copy of the whole system, such as half the servers. A hot standby runs a full-size copy. Each plan recovers faster than the one before it, and costs more every day.

  3. Choose who serves: one region or both

    In , one region takes all the writes and the other waits as a standby. In , both regions serve nearby users and copy their writes to each other. When one fails, its users move to the other, which is already serving. The price is conflicts: two regions can change the same record at the same moment.

  4. Replicate across regions

    Pick a case to follow below

    With this case: The payment was confirmed at 5 ms but never reached EU-West, so the failover lost it.

    Users, in the USUsersin the USDNS, TTL 5 sDNSTTL 5 sUS-East, primary, NOWUS-Eastprimaryp-91 savedNOWEU-West, standbyEU-WeststandbyWitness, third siteWitnessthird site
    • Users — in the US — healthy
    • DNS — TTL 5 s — healthy
    • US-East — primary — healthy — NOW — p-91 saved
    • EU-West — standby — healthy
    • Witness — third site — healthy
    • Write
    • Copied write
    Step 1 of 3

    Step 1 of 3 · US-East

    Done: US-East saves the payment and confirms it

    What happens
    The primary writes p-91 and tells the user it is saved at 5 ms.
    Why
    With async copying, the primary does not wait for the other region.
    What changes
    The copy to EU-West leaves now and takes 40 ms.
    Next
    US-East fails at 30 ms
    User told "saved"
    at 5 ms
    In EU-West
    not yet
    Watch: confirmed, not copied

    Step 1 of 3: US-East. US-East saves the payment and confirms it. The primary writes p-91 and tells the user it is saved at 5 ms.

    With , the primary confirms a write first and copies it afterwards. Writes stay fast, but a failure loses whatever was not yet copied. With replication, a write is confirmed only after the second region has it too. A confirmed write then survives the loss of one region, but every write waits for the trip between regions. If the far region cannot be reached, the write cannot be confirmed at all.

    In the picture, a trip between the regions takes 40 ms. With async copying, payment p-91 is confirmed at 5 ms, and US-East fails at 30 ms, before the copy lands. EU-West takes over without it. With sync copying, the payment is confirmed at 85 ms, after EU-West has it, so the failover loses nothing.

  5. Detect, fence and fail over

    Pick a case to follow below

    With this case: US-East was fenced before EU-West took over, so only one region took writes. Users moved about 20 seconds after the link broke.

    Users, in the USUsersin the USDNS, TTL 5 sDNSTTL 5 sUS-East, primaryUS-Eastprimarycut offEU-West, standbyEU-WeststandbyWitness, third site, NOWWitnessthird siteUS-East: down?NOW
    • Users — in the US — healthy
    • DNS — TTL 5 s — healthy
    • US-East — primary — healthy — cut off
    • EU-West — standby — healthy
    • Witness — third site — healthy — NOW — US-East: down?
    • Health check
    • Instruction
    Step 1 of 4

    Step 1 of 4 · Witness

    Watch: The witness marks US-East down after 15 s

    What happens
    Checks every 5 seconds get no answer 3 times in a row.
    Why
    One missed check could be a blip, so several are needed.
    What changes
    But US-East is still running, and users near it can still reach it.
    Next
    US-East stops taking writes
    Time since the link broke
    15 s
    Regions taking writes
    US-East

    Step 1 of 4: Witness. The witness marks US-East down after 15 s. Checks every 5 seconds get no answer 3 times in a row.

    What these pictures simplify. These pictures use stated times: 40 ms one way between regions, checks every 5 seconds and a 5-second TTL. Real trips depend on the distance, and some devices keep a DNS answer longer than its TTL.

    Health checks call each region every few seconds, and mark one that stops answering as down. Before the standby is promoted to primary, the old primary must be stopped from taking writes. This is called fencing. A third site, called a , gives a third vote: only a side that can reach two of the three sites may take writes. Then DNS or a global sends users to the new primary. Devices keep the old DNS answer until its (time to live) ends.

    In the picture, the link to US-East breaks, but US-East still runs. Checks every 5 seconds miss 3 times, so it is marked down after 15 seconds. With fencing, US-East cannot renew its lease with the witness, so it stops taking writes before EU-West is promoted. A 5-second TTL then moves users about 20 seconds after the link broke.

    With no fencing, both regions take writes at once. Two users can change the same account in two places, and one change must later be merged or thrown away.

  6. Warm up and rehearse

    A standby is smaller than the primary, and its caches are empty. Scale it up before it takes all the traffic: the warm standby in the lab above needs 8 more seconds. Practise the whole failover on a schedule. A plan that has not been run often fails in a way nobody planned for.

Use it when

  • Downtime or lost data costs more than a second region: a payment system or a large shop loses money each minute it is down.
  • Users live on several continents: active-active serves each user from a region near them, so pages load faster.
  • A contract or a regulator asks for it: some require a tested recovery site far from the main one.

Skip it when

  • An early or internal service: backups plus several , the separate data centres inside one region, often meet the RTO.
  • Active-active for data that two regions often change at once, such as a stock count: every conflict needs a rule you have designed.
  • A team with no time to rehearse failover: an untested standby costs money every day and may not work when needed.

Check yourself

What does RPO measure?

Judgement

Trade-offs and how it fails

What you give up

Cost
A second region that can take all the traffic needs about as many servers as the first, so the server bill about doubles. A warm standby at half size costs less each day. It pays for that with time to scale up after a failure.
Consistency
Asynchronous copying keeps writes fast, but the standby is behind, so a failure loses recent writes. Synchronous copying keeps every confirmed write, and each write waits for the far region. Active-active also needs a rule for conflicts, such as , which drops one of two clashing writes.
Speed
Automatic failover is fast, but a false alarm can start a move that nobody needed. A person deciding is slower and avoids that. A middle path is to automate every step and let a person decide when to start.

Failure modes

  • The standby is overloaded: it gets all the traffic with half the servers and empty caches, and fails too. Scale it up and warm it before the full move.
  • : a network fault cuts the regions apart, and both act as primary and accept writes. Fence the old primary, or use a witness, before you promote.
  • Confirmed writes are lost: the old primary held writes that had not reached the standby. When it returns, they must be thrown away or merged by hand.
  • Failover on a false alarm: a short network fault makes a healthy region look dead. The move itself then causes the outage.
  • Users stuck on the dead region: their devices keep the old DNS answer until the TTL ends, and some software keeps it longer.
  • A shared part outside both regions: both depend on one sign-in service or one settings store. When it fails, both regions fail together.

In the real world

  • Netflix has described an exercise it calls Chaos Kong. It simulates the loss of a whole AWS region and moves the traffic to the other regions.
  • GitHub's report on its October 2018 incident says the link to its main data centre was down for 43 seconds. Its failover tool promoted databases in another data centre. Some writes had not been copied, and service was degraded for 24 hours and 11 minutes. Source: GitHub blog: October 21 post-incident analysis (2018) (checked 14 October 2026)
  • The AWS guide to reliability lists four recovery plans. From cheapest to fastest: backup and restore, pilot light, warm standby, and active-active across sites.
  • Google's Spanner paper (2012) describes a database that confirms a write only after most of its copies have it. The copies can sit in different regions. Source: Google: the Spanner paper (2012) (checked 14 October 2026)

Trade-offs to be ready to discuss: Active active vs active passive

Check yourself

Why is active-active across regions harder than active-passive?

Interview

What interviewers look for

  • Ask for the two numbers before you draw anything: "How much data can we lose, and how long can we be down?"
  • State the cost with the choice: "A warm standby at half size meets a 15-minute RTO. Active-active would double the servers for little gain here."
  • Say what is lost: "Replication is asynchronous with about 500 ms of lag, so a failover can lose the last half second of writes."
  • Name two failover risks with their fixes: fence the old primary against split brain, and scale up the standby before it takes all the traffic.

Say it out loud: With asynchronous replication between regions, what RPO can you meet?

A region fails, and all of its traffic moves to a standby region. The standby runs at half the size, with empty caches. What is the main risk?

Expected depth by interview level

Levels describe the depth interviewers probe, not years of experience. Choose a level on the learning path to highlight it.

JuniorBeyond this level
Not usually expected.
MidUseful
Backups, and more than one data centre in a region.
SeniorCore
RPO and RTO, active-passive failover, replication lag.
StaffCore
Active-active vs standby as a cost and consistency decision.

Practice

Apply it

Three harder questions

The first two use the idea on a new case. The last asks you to judge a design.

Apply it

Asynchronous copying runs 2 seconds behind, and 500 writes arrive each second. The primary region fails. About how many confirmed writes are lost?

Apply it

Payments must lose almost nothing. Page-view counts for a weekly report can lose an hour. How should the two be protected?

Judge a design

Two regions run active-passive. Both use one sign-in service that runs only in the first region. What is the weakness?

Next: architecture evolution, how a system and its team boundaries change as it grows.

Go deeper

Sources and further reading

First-hand sources to check this page against and to go further. They are standards, official docs, original papers, and guides from engineering and security teams. Each link was opened on 8 November 2026.