Be Software Architecture Wise
Be Wise Apps

Leer en español · Lire en français · Auf Deutsch lesen

Section 10.6 of 10.8 · Advanced · 24 min read

Multi-region, disaster recovery and edge computing

Video lesson

5 min · narrated, with captions
Listen only (audio)
Read the transcript

Several availability zones in one region are the normal baseline. Running in several regions is a much bigger and more expensive step. In this lesson you'll learn when it's worth it, and how much to buy.

A shop chain that keeps all its stock in one warehouse is in trouble if it floods. It could keep an inventory list and a spare key to an empty building: cheap, but slow to recover. It could keep a small second warehouse, stocked and staffed: dearer, but quick. Or it could run two full warehouses all the time: dearest, with almost no interruption. It can also put small kiosks near customers for the most popular items. Multi-region and edge design make the same choices for software.

There are only three good reasons to use several regions. First, latency. Light in fibre travels at roughly two hundred thousand kilometres a second, so a London to Sydney round trip can't take less than about 170 ms. Second, disaster recovery. Whole regions do fail, usually through a shared dependency. In October 2025, a fault in the automation managing DNS records for Amazon DynamoDB caused about three hours of errors, with knock-on failures into the next afternoon. Third, data residency: law, regulators or contracts may require some data to stay in particular jurisdictions. Without one of these reasons, many teams really need good multi-zone design, tested backups and a CDN.

Two numbers drive every disaster recovery design. The recovery time objective, or RTO, is how long the service may be unavailable. The recovery point objective, or RPO, is how much recent data may be lost, expressed as time. Both come from the business, ideally from the cost of an hour of outage, not from engineers' preferences. And the cost rises steeply near zero.

With backup and restore, only backups, and the code to rebuild, sit in the recovery region. Recovery takes hours; without infrastructure as code, the RTO is fiction. With a pilot light, the database is replicated, but the application servers are off. Recovery takes tens of minutes, if you can get capacity during a regional crisis. With a warm standby, a small but fully working copy is already running, and recovery takes minutes. With active-active, a full copy is already serving traffic. Both numbers are near zero, but it needs a data design for writes in several regions. Two warnings apply to every column. Replication is not a backup: it copies deletions and corruption faithfully. And a strategy that hasn't been rehearsed is a hope, not a plan.

Traffic is steered between regions by DNS or a global load balancer, which health-checks each region. Here, it sends all traffic to region A. Region A's database leader replicates asynchronously to a read-only replica in region B. Whatever hasn't arrived when region A fails is lost, so the replication lag is the real recovery point. Region B gets traffic only after failover. Systems with enough capacity already running ride out a failure. Systems that must launch new machines can't recover until the failed region does.

Let's choose for the food delivery platform. Contracts with large restaurant chains promise ordering is back within an hour. So the ordering core needs an RTO of one hour or less, and an RPO under a minute. Backup and restore adds about two thousand pounds a month, but a measured rebuild takes four to six hours. It fails. Pilot light adds about eight thousand pounds a month and fails over in thirty five to fifty minutes, but only if capacity can be obtained during a regional event. Warm standby adds about eighteen thousand pounds a month, and fails over in about ten minutes. It meets the target with margin. Active-active adds about forty five thousand pounds a month, plus about six months of one engineer's time to redesign the order and payment data. Far beyond the need. So: warm standby for the ordering core, backup and restore for the rest, and menus served from the CDN. About twenty thousand pounds a month extra. Disaster recovery is bought like insurance.

Regions protect against regional disasters. But most outages come from the system's own changes, overloads and bad inputs, which a second region running the same code suffers too. Cell-based architecture runs many complete, independent copies of the system, called cells, each serving a fixed subset of customers behind a thin router. If one cell gets a bad deployment or a noisy customer, only its customers are affected: with twenty cells, about five per cent. Finally, the edge. CDNs and edge functions, such as Cloudflare Workers, which this course runs on, serve reads and light logic near users. The usual pattern: read at the edge, and write at the origin.

The full section covers data design across regions, shuffle sharding and a decision guide. Next, in Section ten point seven, we turn to platform engineering. See you there.

What you need to know

Why run in more than one region

Section 0.7 (servers and the cloud) introduced regions (separate geographic areas) and availability zones (independent data-centre groups inside a region), and section 10.1 showed how providers organise them. Running across several availability zones in one region is the normal baseline for any production system: it survives the loss of a data centre at little extra cost, because zones are close enough for synchronous replication. Running across several regions is a much bigger step, and there are only three good reasons to take it.

Latency. Light in optical fibre travels at roughly 200,000 km per second, so a round trip between London and Sydney (about 17,000 km in a straight line) cannot take less than about 170 ms, and real routes take considerably longer. A request that needs several round trips to a distant region feels slow however fast the servers are. Serving users from a nearby region, or from the edge, is the only fix.

Disaster recovery. Whole regions do fail, usually through a shared dependency rather than a physical disaster. On 19 and 20 October 2025, a race condition in the automation that manages DNS records for Amazon DynamoDB left its US-EAST-1 endpoint with an empty DNS record; DynamoDB errors lasted about three hours, but knock-on failures in launching new virtual machines and in load balancer health checks lasted into the following afternoon. Every large provider has had comparable regional incidents. Disaster recovery plans for them.

Data residency. Data residency requirements, from law, regulators or customer contracts, may require certain data to be stored or processed in particular jurisdictions. The GDPR itself restricts transfers of personal data out of the European Economic Area rather than demanding local storage, but sector rules, national laws and enterprise contracts often go further (see privacy by design). Residency often forces multi-region designs in which data is deliberately not replicated everywhere.

Multi-region is expensive: duplicated infrastructure, cross-region data transfer charges, harder data consistency and more complex operations and testing. Many teams that believe they need it actually need good multi-zone design, tested backups and a CDN.

Recovery objectives and the four strategies

Section 2.5 (availability and reliability) defined the two numbers that drive every disaster recovery design. The recovery time objective (RTO) is how long the service may be unavailable; the recovery point objective (RPO) is how much recent data may be lost, expressed as time. Both come from the business, ideally from the cost of an hour of outage and of a lost order, not from engineers' preferences. Lower values cost more, and the cost rises steeply near zero.

The AWS Well-Architected whitepaper Disaster Recovery of Workloads on AWS: Recovery in the Cloud describes four strategies, in order of increasing cost and complexity. The names are widely used beyond AWS and apply equally to Azure, Google Cloud or a pair of private data centres.

Disaster recovery strategies

Four disaster recovery strategies: backup and restore, pilot light, warm standby and active-active, showing what runs in the second region and the typical recovery time and data lossBackup andrestorePrimary regionfull systembackups copiedRecovery regionbackup copies only;nothing runningRTO: hoursRPO: since last backupPilot lightPrimary regionfull systemdata replicatedRecovery regiondatabase replica;app servers offRTO: tens of minutesRPO: seconds to minutesWarm standbyPrimary regionfull systemdata replicatedRecovery regionsmall working copyrunning, scales upRTO: minutesRPO: seconds to minutesActive-activePrimary regionfull systemreplicated both waysSecond regionfull copy, alreadyserving trafficRTO: near zeroRPO: near zerocost, complexity and readiness increase from left to right
Each step to the right keeps more of the system running in the second region, buying lower RTO and RPO with higher continuous cost.

Disaster recovery strategies compared

StrategyWhat runs in the second regionTypical RTOTypical RPORelative cost and main risk
Backup and restoreNothing but backup copies (database snapshots, object storage) and the infrastructure code to rebuild.Hours, depending on data volume and automation.The backup interval (minutes with continuous log backups, hours with daily snapshots).Lowest. Restores are slow and often untested; without infrastructure as code the RTO is fiction.
Pilot lightReplicated databases and core infrastructure; application servers defined but not running.Tens of minutes: start and scale the application tier, then redirect traffic.Seconds to minutes (replication lag).Low. Scaling up during a regional crisis competes with everyone else for capacity.
Warm standbyA scaled-down but fully working copy of the whole system.Minutes: redirect traffic, then scale up.Seconds to minutes.Moderate. The standby can be tested with real traffic, but drifts if not deployed with every release.
Multi-site active-activeA full copy serving live traffic in every region.Near zero: traffic is redistributed, no failover needed.Near zero for replicated data; corruption still needs backups.Highest. Requires a data design for concurrent writes in several regions.

The whitepaper itself gives one rough figure covering both RTO and RPO for each strategy; the table separates them because, with continuous replication, the RPO of pilot light and warm standby is set by replication lag rather than by how much of the application is running. Two warnings apply to every column. Replication is not a backup: an accidental deletion, a bad migration or ransomware is replicated faithfully within seconds, so point-in-time backups, ideally immutable and in a separate account, are needed even in an active-active design. And a strategy that has not been rehearsed is a hope, not a plan. Teams that run a regional failover exercise at least a few times a year discover missing permissions, hard-coded endpoints, expired certificates and quotas that are too small in the recovery region, while it is still cheap to find them.

Replicating data across regions

Stateless application servers are easy to run in two places; the data is the hard part, and the trade-offs are those of consistency, CAP and PACELC at continental distances. Synchronous replication across regions means every write waits for at least one long round trip, perhaps 70 to 150 ms or more, which is acceptable for a few critical writes and ruinous for chatty ones. Asynchronous replication keeps writes fast but means the replica lags, and whatever has not arrived when the primary region fails is lost: the replication lag is the effective RPO.

There are four common data designs. Single primary region: all writes go to one region and replicas elsewhere serve reads and recovery; simple, but distant users pay write latency and failover means promoting a replica (with the split-brain risks described in replication and partitioning). Home region per entity: each customer, restaurant or tenant has a home region where its data is written, which keeps writes local and supports residency, at the cost of routing and of rare cross-region operations. Multi-writer with conflict resolution: every region accepts writes and conflicts are merged, for example by last-writer-wins (the default in DynamoDB global tables) or by conflict-free replicated data types; safe only for data where merging is meaningful, such as a basket, and dangerous for money or stock. Globally consistent databases such as Google Spanner or CockroachDB pay consensus latency on writes to give strong consistency across regions; Azure Cosmos DB lets each application choose among five consistency levels, from strong to eventual.

Most real systems mix these per data set, exactly as section 6.6 recommends: payments and order state in a single primary or home region, menus and restaurant details replicated everywhere for reads, and analytics shipped asynchronously.

Failover, DNS and static stability

Traffic is steered between regions by DNS or by a global load balancer. With DNS-based failover, the DNS service health-checks each region and returns the address of a healthy one; its weakness is caching, because resolvers and clients may hold old answers for longer than the record's TTL. Global load balancers (for example AWS Global Accelerator, Azure Front Door, Google Cloud's global external load balancer, Cloudflare) use anycast addresses announced from many locations, so clients keep one address and the provider shifts traffic within seconds.

Failover between a primary and a standby region

Two regions behind DNS or a global load balancer: region A serves all traffic and replicates its database asynchronously to a read-only replica in region B, which receives traffic only after failoverUsersDNS or global load balancerhealth-checks each regionRegion A (primary)Region B (standby)Applicationseveral AZsDatabase leaderaccepts writesApplicationscaled down or offDatabase replicaread-only until promotedall trafficonly after failoverasync replicationlag = data at risk
Whatever has not been replicated when region A fails is lost, so the replication lag sets the real recovery point.

Deciding when to fail over is harder than the mechanism. Automatic failover reacts fastest but can be triggered by a monitoring fault or a brief network blip, and failing over a database risks two primaries accepting writes. Many organisations therefore automate detection and the failover steps but keep a human decision to start a regional failover, with a runbook and a time limit. Failing back after the incident, including re-synchronising data written in the recovery region, needs a plan too.

The October 2025 incident illustrates a principle that the AWS Builders' Library calls static stability: a system should keep working during a failure without having to make changes at that moment. Systems that already had enough capacity running rode out the problem; systems that needed to launch new instances, or whose recovery depended on control-plane actions in the affected region, could not recover until the region did. For disaster recovery this argues for pre-provisioned capacity (warm standby rather than pilot light, for critical paths), for failover that depends only on the healthy region's data plane, and for DNS, identity and secrets that do not live solely in the region you are escaping.

Cells: limiting the blast radius

Regions protect against regional disasters; most outages, however, are caused by the system's own changes, overloads and poison inputs, which a second region running the same code and configuration will suffer too. Cell-based architecture limits the blast radius of such failures by running many complete, independent copies of the system, called cells, each serving a fixed subset of customers. A thin router maps each request to its cell, usually by customer or tenant identifier. Cells share nothing at run time: each has its own application instances, queues and databases.

If one cell suffers a bad deployment, a hot customer or data corruption, only that cell's customers are affected: with 20 cells, about 5% of them. Deployments roll out cell by cell in waves, so a bad release is caught in the first cell. The design is described in the AWS Well-Architected whitepaper Reducing the Scope of Impact with Cell-Based Architecture (2023) and is used at large scale by AWS's own services and by companies such as Slack. A related technique, shuffle sharding, gives each customer a random combination of a few workers out of many (with 8 workers and 2 per customer there are 28 combinations), so a customer whose requests crash workers takes down only its own combination, and most other customers share at most one worker with it.

Cell-based architecture

Cell-based architecture: a thin router maps each customer to one of four complete, independent cells; a failure in cell 3 affects only that cell's customersClientsCell router (thin)customer ID to cell lookupCell mappingsmall, cachedCell 1API + workersown databasecustomers ACell 2API + workersown databasecustomers BCell 3API + workersown databasefailingCell 4API + workersown databasecustomers DA fault, bad deployment or noisy customer in cell 3 affects about a quarter of customers, not all
The router must be the simplest, most reliable component in the system, because it is the one thing all cells share.

Cells cost something: more instances and databases to run, cross-cell operations (reports across all customers, moving a customer between cells) that need separate machinery, and a router and mapping service that must be extremely simple and reliable. They suit large multi-tenant systems with natural partition keys; for a single-tenant internal application they are over-engineering.

The edge: CDNs and edge functions

Between users and regions sits the edge: the hundreds of locations operated by content delivery networks such as Akamai, Cloudflare, Fastly, Amazon CloudFront and Azure Front Door. A CDN caches static and cacheable content (images, scripts, menu pages) near users, following the HTTP caching rules described in caching, and absorbs traffic spikes and many denial-of-service attacks before they reach the origin.

Edge functions go further by running code at those locations: Cloudflare Workers, Fastly Compute, CloudFront Functions and Lambda@Edge, Akamai EdgeWorkers, and the edge functions of platforms such as Vercel and Netlify. Cloudflare Workers runs code in lightweight V8 isolates, the sandboxes JavaScript engines use for browser tabs, rather than in a container per function, so start-up is very fast and many tenants share one process safely. This course itself runs on Cloudflare Workers. Good uses are request routing and A/B assignment, authentication checks and token validation, header and redirect rules, image resizing, simple personalisation, and API proxies that keep secret keys out of the browser.

The limits are architectural. Edge functions have tight CPU-time and memory limits; edge storage is usually eventually consistent (Cloudflare's Workers KV can take some time to propagate a write globally) or offers strong consistency only for a single coordinating object, as Durable Objects do; and the system of record normally stays in a region. A common pattern is therefore read at the edge, write at the origin: serve menus, restaurant pages and session checks from the edge, and send orders and payments to the home region.

Decision guide

Decision guide: how much multi-region do you need?

Answer for each important user journey, not for the whole system at once.

  1. Can the business tolerate this journey being unavailable for several hours while a region is rebuilt from backups?
    YesUse several availability zones in one region plus tested, automated, cross-region backup and restore. Revisit if the business changes.
    NoContinue: a standby in another region is needed.
  2. Is a recovery time of tens of minutes acceptable, and can you count on obtaining capacity during a regional incident?
    YesPilot light: replicate data continuously, keep infrastructure as code ready and automate the scale-up and traffic switch.
    NoContinue: capacity must already be running.
  3. Is a recovery time of a few minutes acceptable, with reduced capacity at first?
    YesWarm standby: run a small working copy, deploy to it with every release and send it a little real traffic to prove it works.
    NoActive-active, with a data design for multi-region writes (home regions or a globally consistent database); budget for the engineering, not just the infrastructure.
  4. Do distant users need fast writes, or must some data stay in their jurisdiction?
    YesPartition by geography: give customers a home region and keep their data there, rather than replicating everything everywhere.
    NoServe distant users' reads through a CDN and edge functions and keep writes in one primary region.

Worked example

Worked example: choosing a DR strategy for the food-delivery platform

The platform runs in one region across three availability zones. The ordering core (ordering, payment, dispatch) costs about 60,000 a month in infrastructure. It handles about 40,000 orders a day, peaking at 6,000 an hour at dinner, with about 5 in platform revenue per order. Leadership asks for a recovery plan for a regional outage. All figures are illustrative, in pounds.

Cost of an outageRevenue averages about 8,000 an hour over the day and reaches 30,000 at peak. Customer, restaurant and courier goodwill roughly doubles the true cost. Contracts with large restaurant chains promise ordering is restored within one hour.
RequirementRTO of 1 hour or less and RPO of under 1 minute for the ordering core; RTO of 24 hours for analytics, recommendations and marketing.
Backup and restoreExtra about 2,000 a month. Measured rebuild: 4 to 6 hours (2 TB database restore dominates). Fails the 1-hour RTO.
Pilot lightExtra about 8,000 a month (continuous database replica, networking, images ready). Rehearsed failover: 35 to 50 minutes, mostly scaling the application tier. Meets the RTO only if capacity can be obtained during a regional event.
Warm standbyExtra about 18,000 a month (replica plus application at 20% scale). Rehearsed failover: about 10 minutes, then scale-up while serving. Meets the RTO with margin.
Active-activeExtra about 45,000 a month plus an estimated six engineer-months to redesign order and payment data for multi-region writes. Near-zero RTO, far beyond the requirement.
DecisionWarm standby for the ordering core; backup and restore for analytics, recommendations and marketing; menus and restaurant pages served from the CDN so browsing continues during failover. Total extra cost about 20,000 a month, about a third of the core's infrastructure.
ConditionsStandby is deployed by the same pipeline with every release, receives 2% of real traffic to prove it works, and a full failover is rehearsed each quarter. The decision is recorded in an ADR.

The expected loss from a rare regional outage alone would not justify warm standby; the contractual RTO and the reputational damage of a long outage at dinner time do. DR is bought like insurance, and the business sets the premium it is willing to pay.

Tiering by journey cut the cost substantially: only the part of the system that must recover quickly pays for fast recovery.

Check your understanding

Why does an active-active design still need point-in-time backups?

Replication copies deletions, bad migrations and corruption to every region within seconds; only backups let you restore the data as it was before the mistake.

In a design with asynchronous replication to a standby region, what determines how much data is lost in a regional failure?

The replication lag at the moment of failure: writes that had not yet reached the replica are lost, so the lag is the effective RPO.

What failures does a cell-based architecture protect against that a second region running the same code does not?

Failures caused by the system itself, such as a bad deployment, a poison input or an overloaded customer, which would affect every region but only one cell.

Why is pilot light riskier than warm standby during a large regional incident?

Pilot light must launch and scale the application tier at the moment of failure, when capacity and control-plane operations may be scarce; warm standby already has working capacity running.

Next · 10.7Platform engineeringWhy organisations build internal developer platforms, golden paths and Backstage, running the platform as a product with self-service and guardrails, reducing cognitive load, measuring success with DORA and SPACE, and avoiding the common traps.Continue →

Sources and further reading

Have a question about this section? ArchitectBot, the course’s AI study assistant, answers from the course first.

Ask: “Our food-delivery app runs in one cloud region. How do I work out whether we need pilot light, warm standby or active-active, and what it would cost?”