Disaster recovery and multi-region design

Topic 6 of 8 in Week 6: Production concerns10 min readAdvancedFree course

Overview

High availability (week 2) keeps you running when machines or a single availability zone fail. Disaster recovery (DR) plans for bigger events: a whole region outage, a major provider incident, a ransomware attack, or a catastrophic human error. Because DR is expensive, the right level depends on what downtime and data loss cost the business: the RTO and RPO from week 3.

The strategies

Disaster recovery strategies from cheapest to most expensive. Backup and restore: restore backups in a new region, with an RTO of hours and an RPO of hours to a day, cost one dollar sign. Pilot light: data is replicated and servers are off, RTO tens of minutes and RPO minutes, cost two dollar signs. Warm standby: a small copy is running and scales up on failover, RTO minutes and RPO seconds, cost three dollar signs. Active-active: every region serves traffic, RTO around zero and RPO zero to seconds, cost four dollar signs. Cheaper means slower recovery and faster means costlier. Match the strategy to each system’s RTO and RPO, practise failover regularly, and note that active-active needs multi-region data replication and a plan for conflicting writes, or one write region.

Backup and restore

Back up data (and infrastructure definitions) to another region. In a disaster, build the environment there and restore. Cheapest, slowest: hours to a day, and you lose whatever changed since the last backup.

Pilot light

Keep the core data continuously replicated to the second region, with the minimum infrastructure defined but turned off or tiny. On failover, start and scale the application around the data. RTO tens of minutes, RPO minutes or less.

Warm standby

Run a scaled-down but fully working copy of the system in the second region, with data replicated. On failover, scale it up and switch traffic. RTO minutes, RPO seconds.

Active-active (multi-site)

Serve production traffic from two or more regions all the time. Losing a region means the others absorb its traffic. RTO near zero. The hard part is data: if every region accepts writes, you need conflict handling (multi-leader replication) or a globally consistent database (Spanner, CockroachDB), which adds write latency. A common compromise is active-active for reads, single region for writes per user or per dataset (for example, each user’s data has a home region).

Data across regions

  • Asynchronous replication (most databases’ cross-region replicas, S3 cross-region replication) is fast for writes but means the last seconds of writes may be lost in a failover (RPO > 0).
  • Synchronous replication across regions gives RPO 0 but adds the inter-region round trip (tens to hundreds of milliseconds) to every write.
  • Don’t forget the rest of the state: object storage, search indexes, caches (can be rebuilt), queues (in-flight messages), secrets and configuration.

Failover mechanics

  • Traffic: DNS failover with health checks and short TTLs, or global load balancers and anycast.
  • Data: promote replicas to primaries, carefully avoiding split brain (fence the old region if it comes back).
  • Dependencies: check that third-party services, identity providers and payment gateways are reachable from the DR region.
  • Automation vs. a human decision: automatic failover is fast but can trigger on false alarms; many teams automate detection and preparation and keep a human “go” decision for regional failover.
  • Failback: returning to the primary region later is a migration too; plan and practise it.

Beyond infrastructure failures

Some disasters are logical: a bad deploy corrupts data in every region, or an attacker deletes resources. Replication copies those instantly. Defences: point-in-time recovery, immutable backups in a separate account, delayed replicas, and strict access controls.

Test it

Run DR drills: fail over a non-critical system, or game-day a region failure in staging and periodically in production. Measure the actual RTO and RPO and compare them with the targets; update runbooks with what you learn. Untested plans usually fail on details like expired credentials, missing capacity in the DR region or hard-coded region names.

In an interview

For high-stakes systems, when asked “what if the whole region goes down?”: “We run warm standby in a second region: the database replicates asynchronously, so RPO is a few seconds; the app runs at small scale there and autoscales on failover; DNS health checks switch traffic, giving an RTO of about 15 minutes. We drill this quarterly.” For global, always-on products, discuss active-active and how writes are handled.

Recap

Disaster recovery prepares for losing a region or suffering a catastrophic error. Choose among backup and restore, pilot light, warm standby and active-active based on RTO, RPO and the cost of downtime. Cross-region replication is usually asynchronous, so plan for some data loss unless you pay the latency of synchronous writes. Automate what you can, protect against logical disasters with immutable backups, and rehearse failover and failback.

Exercise

Choose a DR strategy

Choose a disaster-recovery strategy for each system and justify it with RTO and RPO: (a) a company's internal wiki; (b) an e-commerce store doing most of its revenue online, where an hour of downtime costs ₹50 lakh; (c) a global payment platform with strict regulatory uptime requirements; (d) a nightly analytics pipeline.

Text
(a)
(b)
(c)
(d)

Summary

  • Disaster recovery plans for losing a whole data centre or region, not just a machine.
  • Strategies range from backup and restore (cheap, slow) through pilot light and warm standby to active-active (fast, expensive).
  • Each strategy is chosen from the system's RTO and RPO and the cost of downtime.
  • Cross-region data replication is usually asynchronous, so some recent writes may be lost unless you pay for synchronous multi-region writes.
  • Automate failover where possible and rehearse it regularly; also plan the failback.