The standard multi-region failure looks like this. A team deploys their application to five regions, measures latency from those five regions, and sees no improvement. The database is still in one region, so every request that touches data still crosses the same distance it crossed before. All that changed is that the request now makes an extra hop on the way.
That outcome is not a mistake in execution. It is a mistake in ordering. Compute placement is downstream of data placement, always, and treating them as separate projects that can be done in either order is the reason most multi-region work produces a bigger bill and no measurable win.
The right order is: decide where the data lives, decide what each region is allowed to do with it, then put compute where the data it needs already is. Everything else follows from those three decisions, including which platform you should use, which is why this article spends most of its length on data and only a little on platforms. A platform that makes it easy to run containers in eight regions has solved the easy half.
The other thing worth saying at the start: the floor here is physics. A round trip between continents takes as long as it takes, and no vendor improves on the speed of light. Every technique below is a way of arranging your system so that fewer operations have to pay that cost, and there is no technique that makes the cost go away.
Key takeaways
- Compute in many regions in front of a single-region database moves the compute and leaves the data, which changes nothing for any request that reads or writes.
- Read replicas make reads local and leave writes remote. That asymmetry is fine until a user writes and immediately reads, which is the bug class that eats most of the schedule.
- Write forwarding hides a cross-region round trip behind a normal-looking query. A handler that issues several sequential writes pays that round trip several times, and this is the most common performance regression after a multi-region migration.
- Failover is a data decision. Promoting a replica has a data loss window and a split-brain risk, and DNS changing is the easy part of it.
Decide what the multi-region requirement actually is
Three quite different requirements get filed under the same heading, and they have different answers. Getting explicit about which one you have prevents most of the wasted work.
Latency. You want users in distant places to experience a fast application. This requires data near those users, or an application shaped so that most interactions do not need data at all. It is the hardest of the three and the one most often attempted without the data work.
Availability. You want to survive the loss of a region. This requires a copy of the data elsewhere, a promotion procedure, and an honest answer to how much data you are willing to lose. It does not require serving traffic from everywhere all the time, and an active-passive arrangement is often the right answer and far simpler than active-active.
Residency. You need certain records to physically stay within a jurisdiction. This is the most tractable requirement because it is a partitioning problem rather than a replication problem: each region has its own data and there is no shared write path. It is also the one where the wrong architecture is a compliance issue rather than a performance one.
Mixing these up produces incoherent designs. A team that needs availability builds an active-active topology to get it, inherits all the consistency problems of active-active, and does not need any of them. A team that needs residency replicates data globally and creates the exact problem they were trying to avoid. Write down which of the three you have, in one sentence, before anything else.
The four data topologies, and what each costs
Everything in this space is one of four arrangements. Each buys something and each takes something.
Single primary with read replicas. One region accepts writes. Others hold asynchronously updated copies for reads. Simple, well understood, supported by every managed database, and by far the most common answer. Reads are local, writes are remote, and there is replication lag between them. The cost is entirely in the asymmetry, and the asymmetry is manageable if you know it is there.
Multi-primary. Several regions accept writes and reconcile. Writes are local everywhere, which is the thing everyone wants. The cost is conflict resolution, because two regions can modify the same row before either has heard about the other. Systems that do this either use consensus, which means a write waits for a quorum across regions and is therefore not actually local in latency terms, or they resolve conflicts after the fact using last-write-wins or a mergeable data type, which means a write can be silently overwritten. There is no third option. Anyone selling you local writes with global consistency and no latency cost is selling one of these two with a nicer name.
Geo-partitioned. The dataset is split so each row has a home region, usually by tenant or by user. Each region is the primary for its own partition and holds no copy of anyone else’s. Writes are local for the users whose home region they are in, there are no conflicts because there is only ever one writer per row, and residency requirements fall out naturally. The cost is that cross-partition operations are expensive or impossible, and anything global, such as an admin view across all tenants, or a report, becomes a fan-out. For a B2B application where a tenant’s data never mixes with another tenant’s, this is frequently the best design available and it is under-used. The schema work behind it is the same work covered in multi-tenant database tools.
Fully replicated, eventually consistent. Every region has everything, writes are accepted anywhere, and convergence happens in the background with a defined merge rule. Excellent for data where merging is well defined: counters, sets, presence, caches, feature flags. Not appropriate for anything with an invariant, like a balance that must not go negative or a unique username.
Most real systems use more than one. Session and preference data replicated everywhere, tenant data geo-partitioned, billing records in a single primary. Picking one topology for the entire application is usually the wrong shape.
Needs first-hand data: Classify every table in your schema into one of the four topologies, and record what fraction of your query volume hits each. That distribution tells you whether a single primary with replicas is sufficient or whether the geo-partitioning work is justified, and it is specific to your access pattern rather than to your data model.
Read replicas and the lag you have to design around
A read replica in a nearby region turns a cross-ocean read into a local one, and that is a genuine and large improvement for read-heavy applications. It also introduces the single most productive source of bugs in this entire area.
Replication is asynchronous. A write commits on the primary, the replica finds out afterwards, and between those two moments the replica is serving stale data. Lag is usually small and it is not bounded: a burst of writes, a long transaction, a network hiccup or a maintenance operation can extend it without warning.
The failure is specific and it will happen on day one. A user updates their profile. The write goes to the primary in one region. The redirect after the form submission lands on a server in another region, which reads from its local replica, which has not received the change. The user sees their old profile and concludes the save did not work. They save again. Now you have a support ticket and possibly duplicate data.
There are four defences and you need to pick one deliberately.
Route reads to the primary after a write, for a window. Set a short-lived marker on the session when a write occurs and send that session’s reads to the primary until it expires. Crude, effective, and it means a user who just wrote pays a cross-region read for a while. This is the most common answer and usually the right one.
Use the database’s consistency token. Several systems let you capture a log position at write time and ask a replica to wait until it has caught up to that position before serving a read. This gives correctness without sending all reads to the primary, and it requires threading a token through your application, which is real work and worth it for a large read-heavy system.
Route by operation type. Anything on the write path, including the reads that immediately follow it, goes to the primary. Anything purely presentational goes to the replica. This is a discipline rather than a mechanism, and it decays without enforcement, because the natural thing for a developer to do is call the same data access function everywhere.
Accept staleness where it does not matter. Public content, search results, dashboards and aggregate counts are fine on a replica. Be explicit about which parts of the product these are, because the default of “everything is eventually consistent” is how you end up with a checkout flow that loses an item.
Whichever you choose, monitor replica lag as a first-class metric with an alert, and make sure your health checks consider a badly lagged replica unhealthy. A replica that has fallen far behind and is still serving traffic is worse than one that is down, because the failure is invisible.
Write forwarding and the round trip it hides
Write forwarding is the mechanism that makes multi-region application deployment feel easy. Your application connects to a local endpoint, issues a write, and the platform routes that write to the primary region and returns the result. No code change. It reads like a normal query.
It is a normal query with a cross-region round trip inside it, and that has three consequences people discover in production rather than in design.
Sequential writes multiply the cost. A handler that inserts a record, updates a counter, writes an audit row and then reads back the result pays the round trip four times. On a single-region deployment those four operations are individually fast and the pattern is invisible. Across an ocean it is the difference between a fast page and a slow one. The fix is to batch the work into one statement or one stored procedure, or to restructure the handler, and both of those are code changes in the place you were promised you would not need code changes.
Transactions are worse than individual statements. A transaction held open across a cross-region link holds locks for the duration of the round trips, not just the duration of the work. Under concurrency this converts a latency problem into a throughput problem, and the symptom is lock contention that did not exist before.
The failure mode is a timeout, not an error. When the primary region is unreachable, forwarded writes hang until something times out. The local region looks healthy, reads work, the application is up, and every write is failing slowly. Make sure your write path has an aggressive timeout and a clear error, because slow failure is much harder to diagnose than fast failure.
The honest guidance: write forwarding is a good tool for applications that are read-heavy with occasional writes, which is most content-shaped applications. It is a bad tool for write-heavy interactive flows, and if your critical path issues a series of writes, you want either the compute for that flow to run in the primary region or a topology where that data’s primary is local. Replaying a request to the primary region, which some platforms do at the routing layer, is often better than forwarding individual statements, because it pays one round trip instead of several.
The consistency cost nobody budgets for
Every multi-region plan I have seen budgets for infrastructure and none of them budget for this. The work is in the application, it is diffuse, and it does not look like multi-region work while you are doing it.
Every read-after-write path has to be found and handled. Not just the obvious form submissions. Background jobs that write and then verify. Webhook handlers that create a record and then look it up by a secondary key. Tests that assert on state immediately after creating it, which will start failing intermittently in CI against a replicated environment and will be blamed on flakiness for weeks.
Uniqueness stops being free. A unique constraint is enforced within one primary. Across a multi-primary topology it is not enforceable without coordination, so “usernames are unique” becomes a distributed problem. The usual answers are to keep the uniqueness-enforcing table in a single primary regardless of what else is distributed, or to make the identifier something that does not require coordination.
Sequences and auto-increment keys become a liability. Monotonic integer IDs assigned by one primary are a bottleneck across regions and a collision risk across multiple primaries. Moving to a random or time-sortable identifier is a schema migration and it touches every foreign key, so do it before the multi-region work, not during it.
Clocks disagree. Any logic that compares timestamps written by different regions, or uses last-write-wins based on wall-clock time, is exposed to clock skew. Ordering by timestamp is not ordering.
Idempotency becomes mandatory rather than advisable. Once requests can be retried across regions, replayed by a router or redelivered after a failover, every operation with a side effect needs an idempotency key. This is straightforwardly good practice that most systems skip, and multi-region is where skipping it starts costing money.
Caches get their own consistency problem. A cache in each region invalidated by an event that travels asynchronously is a second replication system with its own lag, and it usually has worse observability than the database’s.
Budget this as its own workstream with its own engineer. In my experience it is larger than the infrastructure work and it is the part that slips.
Needs first-hand data: Instrument your write path to record, per endpoint, how many database round trips a single request makes. Then multiply by a realistic cross-region round trip time for your geography. The resulting per-endpoint estimate tells you which handlers need restructuring before a multi-region deployment, and it is the most useful number you can produce in a week of planning.
Routing users to regions, and why failover is the hard part
Once data placement is settled, getting a user to the right region is the easy half, with one significant exception.
Anycast advertises the same address from many locations and lets network routing pick. It is the cleanest mechanism because failover is a routing withdrawal rather than a cache expiry, and it is what the edge networks use. You generally get it by being on a platform that provides it rather than by building it.
GeoDNS returns different addresses based on where the resolver appears to be. It works, it is widely available, and it has two known weaknesses: it sees the resolver’s location rather than the user’s, and it depends on TTL expiry, so failover is only as fast as the shortest TTL anyone respects, which is not necessarily the one you set.
Load balancer based routing at a global layer gives the most control, including health-based failover and weighted traffic shifting, and it puts a managed component on your critical path.
The exception, and it is the whole game: routing away from a failed region is easy, and promoting a database in a new region is not.
When the primary region fails, you have a decision with no good options. Promote a replica and accept that anything the primary had committed but not yet replicated is gone, which is your recovery point objective and should be a number you have written down rather than discovered. Or wait for the primary to return and stay down, which is a recovery time objective you have chosen implicitly. Automated promotion adds a third risk, which is split brain, where a network partition causes a replica to be promoted while the original primary is still alive and accepting writes. Two primaries diverging is the worst outcome available here and it is why serious systems require a quorum to promote, or require a human.
Three things to settle before you need them. Know your recovery point objective as an actual number. Practise the promotion, on a schedule, because a procedure nobody has run is a document rather than a capability. And verify that the failed-over region can handle full traffic, because a replica sized for reads will fall over when it inherits the writes too.
What the platforms actually give you
The platform layer is genuinely the smaller half of this, and the differences between them are narrower than the data decisions above. Here is what each class of platform contributes.
Fly.io
Geographic placement is the organising concept rather than an add-on. You declare regions, anycast routing sends each request to the nearest instance, and there is a built-in mechanism for replaying a request to the primary region when it needs to write, which is the right shape because it pays one round trip rather than one per statement. The managed database story follows the single-primary-with-replicas topology, so the read-after-write work described above is still yours.
Cloudflare
Compute is everywhere by default with no region to choose, which removes the compute placement decision entirely and puts all the weight on data. The distinctive contribution is the coordination primitive: an addressable single-threaded object with its own storage that lives in one place and can be moved, which is a geo-partitioned topology expressed as an application object rather than as a database configuration. That is a genuinely different tool and it is worth understanding before assuming you need a distributed database.
AWS
Everything is available and nothing is assembled. Global load balancing, cross-region replication, global database offerings with a single writer and fast replicas, and global tables with multi-primary semantics are all present as separate products you compose. It is the most capable option and the most work, and it is the right choice when requirements are specific enough that a prescriptive platform would get in the way.
Google Cloud
Similar breadth, with the notable difference of a horizontally scaling relational database offering external consistency across regions using synchronised clocks. That is the closest thing to having it both ways in this space, and it is honest about the cost: writes pay a consensus round trip. If you have genuinely global write traffic and strong consistency requirements, it is one of very few real options.
Azure
The same compositional approach, with a multi-model database offering configurable consistency levels as an explicit choice rather than a hidden property. Being asked to pick a consistency level per workload is a better developer experience than discovering the level by debugging, and it forces the conversation this article is about.
Vercel and the framework hosts
Compute for the render path is distributed and the data layer is an integration. That is a coherent position for content-shaped applications, where most requests are cacheable and the dynamic parts are small. It does not remove any of the data work, and the caching layer becomes part of your consistency story rather than separate from it.
Koyeb, Render and Railway
Global or multi-region placement for containers, with varying degrees of first-class support. For these platforms the data question is entirely yours to answer, because the managed database is regional. That is not a criticism; it is the honest state of the category, and it is why the ordering in this article matters.
How to choose
Write down which of latency, availability or residency you actually need. One sentence. This eliminates more architecture than any other step.
Classify your data before you look at any platform. Which tables can be stale, which need a single writer, which can be partitioned by tenant, which are mergeable. Multi-region is a data architecture with a deployment attached.
Count the round trips in your write path. If your critical handlers issue several sequential writes, either restructure them or keep that flow in the primary region. Do this before choosing a platform, because it may tell you that you need a geo-partitioned design rather than a replicated one.
Pick the simplest topology that meets the requirement. Active-passive for availability. Read replicas for read latency. Geo-partitioning for residency and for write latency in a tenant-shaped application. Multi-primary only when you have exhausted the others, and with a clear answer to conflict resolution.
Then pick the platform, and pick the one where your data already is. Cross-provider data transfer costs and the latency between providers will overwhelm any difference in the compute layer.
| Requirement | Topology that fits | Where compute goes | The cost you accept |
|---|---|---|---|
| Read latency for global users | Single primary, read replicas | Near each replica | Replication lag and read-after-write handling |
| Write latency for global users | Geo-partitioned by tenant or user | In each partition’s home region | Cross-partition queries become fan-outs |
| Survive a region failure | Single primary, warm standby | Two regions, one active | A data loss window and a rehearsed promotion |
| Data residency | Geo-partitioned, no cross-region replication | Inside each jurisdiction | Global views and reports become expensive |
| Mergeable state, global | Fully replicated, eventually consistent | Everywhere | No invariants, no uniqueness, merge semantics only |
| Global writes, strong consistency | Consensus-based distributed database | Anywhere | Every write pays a cross-region quorum round trip |
The one-line version: put the data where it needs to be, put the compute next to the data, and be suspicious of any architecture that claims local writes and global consistency without naming what it gives up. The broader platform landscape this sits inside is covered in hosting platforms for developers, and the data layer options in edge databases and serverless databases.
Frequently asked questions
Do I actually need multi-region?
Usually not for latency, and more often than teams think for availability. If your users are concentrated in one part of the world, a well-cached single-region deployment with a CDN in front will beat a badly designed multi-region one. If your requirement is surviving a region failure, an active-passive standby with a rehearsed promotion procedure gives you most of the benefit for a small fraction of the complexity. Reserve full multi-region for genuinely global user bases, hard residency requirements, or availability commitments you have contractually made.
Why did my multi-region deployment not improve latency?
Almost certainly because the data stayed in one region. Compute in many regions in front of a single-region database means every request that reads or writes still crosses the same distance, plus one extra hop. Check the actual path of a request: if it terminates in a region near the user but then makes a database call to a region far away, you have moved the wrapper and left the contents. The fix is read replicas, geo-partitioning, or a caching strategy that lets most requests avoid the database entirely.
What is write forwarding and when should I avoid it?
It is a mechanism where your application writes to a local endpoint and the platform routes that write to the primary region transparently. It is convenient and it hides a cross-region round trip inside every write. Avoid it on write-heavy interactive paths, and especially on handlers that issue several sequential writes, because each one pays the round trip separately. Prefer replaying the whole request to the primary region, which pays the cost once, or restructure the handler so that the writes happen in a single statement.
How do I handle a user reading their own write from a stale replica?
Pick one of four approaches deliberately. Route that session’s reads to the primary for a short window after any write. Use the database’s consistency token so a replica waits until it has caught up to the write’s log position. Classify operations so that anything on the write path, including the reads that follow it, uses the primary. Or decide explicitly that this particular data can be stale and design the interface so the user is not misled. The mistake is having no answer, because then the behaviour depends on which replica the request happened to reach.
Related reading
- Best hosting platforms for developers — the full category, and where multi-region capability sits within it.
- Best edge databases — the data-side options when the requirement is genuinely global reads.
- Best serverless databases — connection behaviour and replication models for distributed compute tiers.
- Best container hosting platforms — the compute layer, once the data placement decision is settled.
- Best edge compute platforms — running the request path everywhere, and what that does and does not buy you.
- Best CDN providers for developers — the cheaper answer when most of your traffic is cacheable.