Data · L3Multi-region systems and data locality

Multi-region systems and data locality

A second region buys speed, survival and legal room. You pay in money, in lag between copies, and in a failover you must practise.

L3 Staff+Data21 min read
Fact-checked by AI against cited sources · Human review pendingLast reviewed 13 Nov 2026 · How we check content
Section 1 of 8

What broke

On 2 November 2023, between 11:44 and 12:01 UTC, a data centre near Hillsboro, Oregon, lost all power. It was called PDX-04. 1

Cloudflare ran its control plane (the dashboard and APIs) and analytics mainly across three data centres in that area. They were built so that the control plane would keep running if any one of them failed. In Cloudflare's words, "The three data centers are independent of one another". 1

The buildings were independent. Some of the software was not. Some services that were meant to survive still used Kafka and ClickHouse clusters that ran only in PDX-04. Some services, mostly for newer products, had not moved to the shared, highly available setup yet. 1

At 13:40 UTC the team chose to fail over to its disaster recovery sites in Europe. The first services came up 3 minutes later. Then the API calls that had been failing all arrived at once, so the team added rate limits. A few newer products did not start properly in Europe. The services that did move were stable by 17:57 UTC. But some log processing stayed down, and every service was back only on 4 November. 1

Two lines from the report stand out. "Throughout the incident, Cloudflare's network and security services continued to work as expected." And: "we had never tested fully taking the entire PDX-04 facility offline." 1 The traffic part was spread across the world. The control part was not.

Section 2 of 8

The idea in simple words

A cloud region is a group of data centres in one area, such as Mumbai or Frankfurt. Running in more than one region gives you three things:

  • Speed. Users near a region get faster answers.
  • Survival. If a whole region fails, another can serve.
  • Data residency. Some laws say certain data must stay in a country. A later lesson on privacy covers this.

The price is real. You run and pay for two or more copies of everything. Each copy of the data lags behind the others. And the failover that should save you is a rare, risky event that nobody has practised.

The key idea. The network between regions is slow, and sometimes it breaks. So for each piece of data, decide which region owns its writes, and what users see while the copies disagree.

Section 3 of 8

How it works

The speed-of-light floor

ITU's planning value for optical fibre is 5 µs per km, one way. 3 That works out to about 200 km per millisecond. So every 100 km of cable adds about 1 ms to a round trip. No code change can beat this.

Real paths are longer than a straight line. Azure publishes measured median round-trip times between its regions. These are for the 30 days to 30 July 2026, in both directions: 2

RegionRegionMedian round trip
East USEast US 28–9 ms
East USWest US67–69 ms
Central IndiaSoutheast Asia53 ms
East USWest Europe83–85 ms
Central IndiaWest Europe139–140 ms
Central IndiaEast US198–201 ms

These are medians. Your slow requests pay more. Now count the round trips. A page that makes 3 database calls in a row, from India to US East, waits about 600 ms before it does any work. Cross-region calls must be few, and never inside a loop.

Active-passive or active-active

In active-passive, one region serves all traffic. The other keeps a copy of the data and waits. Failover is simple to reason about, but you pay for a region that does little, and you only learn if it works on the bad day.

In active-active, every region serves users all the time. Each region is tested by real traffic every day. But now writes can happen in two places, and you must handle conflicts.

The disaster recovery lesson lists the steps in between, like pilot light and warm standby.

Routing users to a region

DNS is the usual tool. Amazon Route 53, for example, can answer with the region that gives the best latency, by the user's location, or by a failover rule that switches from active to passive. 4 DNS answers are cached, so some clients keep using the old region for a while after a change.

Anycast is the other tool: many sites announce one IP address, and the network picks the nearest. See load balancing for how it works. A CDN uses the same idea to serve cached files near users.

Where the writes go

This is the hard part. You have four main choices.

One writer region, read copies elsewhere. Aurora Global Database has one primary region for writes and up to 10 read-only regions. Copies are typically under a second behind. 5 Reads are local and fast. Writes from far away pay the long round trip. All the lag bugs from replication come back, now with bigger numbers.

A home region per user or tenant. Each user's data lives in one region, often the one nearest to them. All their writes go there. A user in Delhi writes to Mumbai. A user in Berlin writes to Frankfurt. No row has two writers, so there are no conflicts. The cost: you need a lookup from user to region, and moving a user is a data migration. The multi-tenancy lesson shows the same idea with cells.

Many writers, conflicts resolved later. DynamoDB global tables accept writes in every region. In the default mode, changes reach other regions "typically within a second or less". 7 If two regions change the same item at once, the one with the latest internal timestamp wins. AWS calls this "last writer wins". 7 The other write is silently gone.

Other surprises follow. A strongly consistent read may return stale data if the item last changed in another region. A conditional write checks only the local copy. A transaction is atomic only in the region that ran it. 7

One logical database with cross-region quorums. DynamoDB also has a strong mode. It runs in exactly three regions: three copies, or two copies and a "witness" that only votes. Each write is copied to at least one other region before it returns. 7 Spanner works in a similar way. Each write needs a majority of five voting copies, one of them in the leader region, so every write crosses at least two regions. 8 No write is silently lost. In DynamoDB, a write that clashes with one in another region fails and must be retried. 7 Every write waits for regions to talk. Spanner advises putting write-heavy work in or near the leader region. 8 This is the PACELC trade, paid on every write.

Conflicts in active-active

Picture a stock count of 5. A buyer in Mumbai takes 1 and writes 4. At the same moment, a buyer in Singapore takes 1 and writes 4. With last write wins, the final count is 4, but two items left the shelf. Neither region saw an error. The quorums lesson explains why timestamps make this worse when clocks drift.

There are three common fixes. Send all writes for one item to one region. Store changes, like "minus 1", that can be added up in any order. Or use the strong mode for the few items that need it.

Failing over and failing back

Step through a region failover. Use Next and Back, or the ← and → keys.

Failing over from one region to another, and failing backUsers Mumbai Singapore writerread-only copyasync copy, about 1 s behind ✗ Mumbai region is downits last 1 s of writes was never copied 1 · fence Mumbai: it must not take writes2 · promote Singapore to writer 3 · DNS sends users to Singaporefull load + a burst of retries Mumbai back: rebuild it as a copylook for the lost writes in its old data ✓ 4 · fail back later, by plan SeniorPath
  1. Active-passive. All writes go to Mumbai. Singapore keeps a copy that is about one second behind, and serves only reads.
  2. The Mumbai region fails. The writes from its last second never reached Singapore. If you fail over now, those writes are missing.
  3. First stop the old writer from taking writes. This is fencing. Then promote Singapore to be the writer. Skip the fence, and you risk split-brain.
  4. Point DNS at Singapore. Clients that cached the old answer move later. Singapore must now carry all the load, plus a flood of retries.
  5. When Mumbai comes back, do not trust its data as it is. Rebuild it as a copy of Singapore. Then look in its old data for writes that never got copied.
  6. Failing back is a separate, planned move. Wait until Mumbai has fully caught up, then switch roles at a quiet hour, with no data lost.
Step 1 of 6

Aurora's docs show the real costs. An unplanned failover "can result in a loss of write transaction data" that had not been copied yet. The RPO is "typically measured in seconds". 6 Aurora tries to stop writes in the old region, but this is best effort. Writes may still land there, which gives split-brain. 6 So Aurora asks you to take apps offline first, and to keep DNS cache times short, such as 5 seconds. 6

Failing back is a separate step. With a managed failover, Aurora adds the old region back as a copy. It first tries to snapshot the old data, so you can look for lost writes. Copy that snapshot if you need it longer than the backup retention period. Later you run a switchover, which waits until the copies match, so no data is lost. 6

Capacity matters too. The surviving region must take all the traffic, plus a burst of retries. Cloudflare hit this. When its services came up in Europe, the API calls that had been failing all arrived at once, and it had to add rate limits. 1

Keep regions from sharing fate

Regions only help if they fail alone. A global control plane can tie them together without anyone noticing.

AWS says some global services have their control plane in one region, while their data plane runs everywhere. IAM, Route 53 and CloudFront have their control planes in us-east-1. 9 AWS advises you to keep these control planes out of your recovery path, so that recovery uses only data plane actions. It calls this being statically stable. 9

Shared data can do the same. In June 2025, Google Cloud's Service Control ran in each region, with its own regional datastore. But a bad quota policy "was replicated globally within seconds", and the crash spread with it. 10 Copy config and policy to one region at a time, as safe deploys explains.

Section 4 of 8

Trade-offs

DesignConflicts?Write latencyData lost on region failureUse it when
One writer region, read copiesNo Far users pay a long round trip.Yes The last seconds of async writes.Most apps that go global first for reads or survival.
Home region per user or tenantNo Each row has one writer.Low for users near home.Yes , for that region's recent writes.Users or tenants map cleanly to a place.
Many writers, last write winsYes One write is dropped.Low everywhere.Small. Seconds of writes not yet copied.Data where losing one of two writes at once is fine, like settings or sessions.
Cross-region quorum (Spanner, strong mode)No silent conflicts. A clashing write fails and you retry.Higher. Every write waits for other regions. How much depends on how far apart they are.No Money, stock and unique names, and you accept slower writes.

Simple rule: start with one writer region and read copies. Move to home regions when far users complain about write speed. Allow many writers only for data you have checked can lose a write.

Section 5 of 8

At work: how a senior uses this

  • Ask first: "Which problem are we solving: speed, survival or law?" Each one leads to a different design.
  • For every table, write down which region owns its writes and what a conflict does.
  • Count cross-region round trips per request, and multiply by the real numbers for your regions.
  • Run a failover drill each quarter. Turn off each whole site or region in a test, not one server. Cloudflare had switched off its other two sites in tests, but never the whole of PDX-04, the one that failed. 1
  • Before a drill, check that the standby region has quotas and capacity for full load, plus retries.
  • List every dependency your failover runbook calls. Remove any that run in only one region.
  • Alert on replication lag between regions. It is your RPO, moving in real time.
Section 6 of 8

With AI

What to ask the agent

"Here is our request handler and its database calls. Our users are in India and our database is in US East. Count the sequential cross-region round trips per request, and estimate the latency with a 200 ms round trip."

"We use DynamoDB global tables in two regions. List every write in this service that could conflict if two regions change the same item, and say what last-writer-wins would drop."

"Write a failover runbook for our Aurora global database. Fence writes first, then fail over, then update DNS. Mark every step that calls a control plane in another region."

What to check yourself

  • The latency numbers come from your provider's measured tables, not a guess.
  • The runbook fences the old writer before it promotes the new one.
  • No step in the recovery path needs a console or API that lives only in the failed region.
  • Any code that checks then writes, like "is stock above zero?", runs in one region only.
  • The test really cuts a whole region, including its queues and caches.
Section 7 of 8

Check yourself

1. Your users are in India. Your only database is in a US East region. Each page makes 3 database calls, one after another. Roughly how long do those calls take, before any work is done?

Show answer

About 600 ms, because each call pays a round trip of about 200 ms. Azure measures about 198–201 ms between Central India and East US. Three calls in a row pay that three times, before any work is done.

2. Two regions write the same DynamoDB item at the same time, in the default global table mode. What happens?

Show answer

The write with the latest timestamp is kept everywhere. The other is dropped without an error. The default mode uses "last writer wins" per item. The losing write is simply gone.

3. Your primary region is down, and you fail over an async replica in another region. What should you expect?

Show answer

The writes from the last few seconds before the failure may be missing. Async replication lags behind. Aurora says failover RPO is typically measured in seconds, and only a planned switchover loses no data.

4. Your service runs in three regions. To fail over, your runbook calls an API whose control plane runs only in one of those regions. What is the risk?

Show answer

If that one region is the one that fails, your recovery step fails too. AWS advises you to keep global control planes out of your recovery path, and to depend only on data plane operations there.

Your progress is saved only in this browser. Export it to keep it safe.

Was this clear?
Report a mistake (opens GitHub in a new tab)
Section 8 of 8

Go deeper

Show 10 sources and related lessons
  1. Cloudflare, “Post mortem on the Cloudflare Control Plane and Analytics Outage” (opens in a new tab)
    One data centre lost power. Services built to survive that still depended on it, and the failover to Europe hit a flood of retried API calls.
  2. Microsoft Learn, “Azure network round-trip latency statistics” (opens in a new tab)
    Measured median round-trip times between Azure regions, in tables you can search by region.
  3. ITU-T Recommendation G.114, “One-way transmission time” (05/2003) (opens in a new tab)
    Table A.1 gives planning values for delay, including 5 µs per km for optical fibre.
  4. Amazon Route 53 Developer Guide, “Choosing a routing policy” (opens in a new tab)
    Failover, geolocation, latency and weighted DNS routing, each in one line.
  5. Amazon Aurora User Guide, “Using Amazon Aurora Global Database” (opens in a new tab)
    One writer region, up to 10 read-only regions, and replication that is typically under a second behind.
  6. Amazon Aurora User Guide, “Using switchover or failover in Amazon Aurora Global Database” (opens in a new tab)
    Failover versus switchover, lost writes, write fencing, split-brain and failing back.
  7. Amazon DynamoDB Developer Guide, “How DynamoDB global tables work” (opens in a new tab)
    Writes in every region, last-writer-wins conflicts, and a strongly consistent mode that costs latency.
  8. Google Cloud Spanner documentation, “Regional, dual-region, and multi-region configurations” (opens in a new tab)
    How a multi-region Spanner database forms a write quorum across regions, and where to put the leader.
  9. AWS Whitepaper, AWS Fault Isolation Boundaries, “Global services” (opens in a new tab)
    Which AWS control planes live in one region, and how to keep them out of your recovery path.
  10. Google Cloud Service Health, “Multiple GCP products are experiencing Service issues.” (12 June 2025) (opens in a new tab)
    A regional service read policy data that was copied to every region within seconds.

Real incident: Cloudflare, 2 Nov 2023: Cloudflare outage: one data centre lost power

Real incident: Google Cloud, 12 Jun 2025: Google Cloud outage: blank policy fields crashed API checks

Related: Replication · CAP, PACELC and consistency models · Quorums and leaderless replication · Disaster recovery and backups · Load balancing · Multi-tenancy and noisy neighbours · Safe deploys and config changes

Term

See full entry

Jump to a section

  1. 1What broke
  2. 2The idea in simple words
  3. 3How it works
  4. 4Trade-offs
  5. 5At work
  6. 6With AI
  7. 7Check yourself
  8. 8Go deeper