Scalability & Architecture Patterns

Multi-Region Architecture

Running a system across multiple geographic regions buys lower latency for distant users and survival of a whole-region outage — at the cost of cross-region data consistency and a much harder operational story.
  • Active-passive: one region serves traffic, another stands by as a warm replica — simple, but standby capacity sits mostly idle and failover has real recovery time
  • Active-active: multiple regions serve traffic simultaneously — better latency and utilization, but every region can accept writes, and those writes must be reconciled
  • Cross-region replication is inherently asynchronous at useful latencies — tens to low-hundreds of milliseconds between continents makes synchronous cross-region writes crater latency
  • GeoDNS or anycast routes each user to their nearest healthy region; health checks must distinguish "degraded" from "down" to avoid routing users into a bad region
  • Conflict resolution — last-writer-wins, CRDTs, or an explicit merge function — is unavoidable in active-active: someone decides what happens when two regions accept conflicting writes for the same record
  • RPO (how much data can be lost) and RTO (how long until service is restored) are the two numbers that should drive active-passive vs active-active, not architectural preference
Active-passive vs active-active
Active-passive vs active-active
Active-PassiveActive-Active
Write pathprimary region onlyany region
Remote-user latencyhigher — routed to primarylower — served by nearest region
Failover timereal — standby must take overnone — other regions already serving
Conflict handlingnot needed — single writerrequired — concurrent writes across regions
Idle capacitystandby mostly unusedall regions doing useful work
Last-writer-wins conflict resolution
Record resolve(Record local, Record remote) {
    return local.updatedAt().isAfter(remote.updatedAt()) ? local : remote;
}
The simplest strategy — silently drops the losing write, fine for some data (a view count) and wrong for others (a shopping cart)
Sources
  • Designing Data-Intensive ApplicationsCh. 5 — Replication
  • System Design Interview – An Insider's Guide, Volume 2Ch. — Multi-Region Architecture