SD System Design In Depth
0%
lesson system-designrecoveryoperations

Disaster recovery

Module 5.1: Production Reliability, SLOs & Resilience Updated Sep 18, 2026
📄 Cheat Sheet
🔥 The Ultimate Guide to Disaster Recovery: RTO, RPO, & Failover!
ByteMonk 🔥 The Ultimate Guide to Disaster Recovery: RTO, RPO, & Failover! Watch on YouTube ↗

Clear animated explanation of RTO and RPO and of the backup, pilot light, warm standby and active-active range covered in this unit.

0:00 / --:--

RTO and RPO Targets

  • RPO (Recovery Point Objective): The maximum acceptable age of data that must be recovered after an outage (measures acceptable data loss).
  • RTO (Recovery Time Objective): The maximum acceptable duration of downtime before systems are restored to operational status.

Disaster Recovery Topologies

Architectures range in cost and capability: Backup & Restore (often hours to days), Pilot Light (minimal core running in a secondary region), Warm Standby (a scaled-down replica stack), and Active-Active Multi-Region (traffic served in multiple regions). Active-active can target low RTO, but replication lag, conflicts, quorum loss, routing convergence, and shared dependencies can still produce nonzero RPO and RTO; the topology alone proves neither target.

DR strategies side by side

StrategyTypical RPOTypical RTOStandby costWhat runs in the DR region
Backup and restoreHours (backup interval)Hours to daysStorage onlyNothing; backups are copied cross-region
Pilot lightSeconds to minutes (async replication)Tens of minutesLowReplicated database; application servers off or scaled to zero
Warm standbySecondsMinutesMediumFull stack at reduced size, scaled up on failover
Active-active multi-regionNear zero to seconds (depends on replication mode)Near zero to minutesHigh (two or more times)Full stack serving live traffic

These ranges follow the AWS disaster recovery whitepaper. They describe what each topology can achieve. Whether you actually achieve them depends on testing.

Worked example: what does failover really cost in time?

This is a warm-standby design with asynchronous database replication. Replication lag is normally 1 to 2 seconds, but reaches about 10 seconds at peak.

  • Detect: health checks fail for 3 consecutive 30-second intervals, so about 90 s.
  • Decide: automatic failover risks flapping and split-brain, so many teams require a person to approve it. Paging and approval take about 5 to 10 minutes.
  • Promote the database: about 1 to 2 minutes. Any writes still inside the replication lag, up to 10 s of data, are lost unless they can be recovered later from the old primary.
  • Scale the application tier from 20% to 100%: about 5 minutes with pre-warmed images.
  • Move traffic: DNS with a 60 s TTL takes minutes to converge, since some clients ignore TTLs. Anycast or a global load balancer takes seconds.
  • Total: RTO of about 15 to 20 minutes and RPO of about 10 s. If the business needs an RPO of zero for payments, those writes need synchronous replication across regions or a consensus-replicated database such as Spanner or CockroachDB. That adds tens of milliseconds of write latency for the cross-region round trip.

Failure modes

  • Split brain: both regions believe they are primary and accept conflicting writes. Use fencing, such as a lease or quorum, so the old primary cannot accept writes after failover.
  • Failback is forgotten: returning to the original region needs its own replication in reverse and its own runbook.
  • Shared fate through dependencies: third-party APIs, secrets managers, CI/CD and the status page itself must not live only in the region that failed.
  • Data corruption replicates: DR replication copies bad writes too. You still need point-in-time backups.

How real systems do it

Netflix runs active-active across several AWS regions and regularly evacuates a region on purpose (Chaos Kong) to prove it can. Google's DiRT exercises test disaster scenarios company-wide. Many banks run warm standby with regulator-mandated annual failover tests. Most SaaS companies use pilot light or warm standby for their databases, combined with cross-region backup copies.

Check yourself Question 1 of 3
Naming RPO and RTO recall
From: RTO and RPO Targets

The business says: we can lose at most the last 5 minutes of orders, and the shop must be taking orders again within 1 hour. How do these map to recovery objectives?

Write-Ahead Log and Crash Recovery

Every change is appended to the log (LSN + checksum) before any data page changes. A commit is acknowledged only after fsync makes its COMMIT record durable. Pages are written lazily, and only once the log is durable up to their page LSN (the WAL rule). Transaction changes reach the page cache at commit (no-steal), so recovery only needs redo.

Log (newest last)
Event log

Key Takeaways

RPO defines allowable data loss; RTO defines allowable downtime duration.
Active-Active provides the lowest RTO but requires distributed data replication strategies.
Conduct regular Chaos Engineering exercises (like Chaos Monkey) to validate failover automation.
Was this lesson helpful? Spot an issue or have a suggestion? Let us know on GitHub.
Report an issue