Disaster recovery (RPO & RTO)
Decide how much data you can lose (RPO) and how long you can be down (RTO), buy the cheapest strategy that meets both, and prove it with regular failover and restore tests.
Analogy: A spare tire in the car (backup), a second car parked at home (standby), or two cars always on the road (active-active). Each one costs more and gets you moving sooner.
How it works
- RPO is how much recent data you may lose; RTO is how long until service returns.
- Four strategies, cheapest first: backup and restore, pilot light, warm standby, multi-site active-active.
- Async replication loses the lag, usually seconds; sync replication gives RPO 0 but slows every write.
- Replication is not backup: a bad delete replicates too. Keep point-in-time backups.
- An untested plan is a guess: run failover drills and restore backups on a schedule.
Check yourself
Answer to mark it learned; your answers aren't scored.
Your orders database replicates asynchronously to a second region, ~2 s behind. At 10:00 a bad migration overwrites the address column for every row; you notice at 10:20. What gets the data back?
Go deeper
Full explanation
Disaster recovery (DR) is the plan for losing a whole site (a data center or a region) or the data itself. Two targets drive it:
- RPO (recovery point objective): how much recent data you may lose, measured in time.
- RTO (recovery time objective): how long until service is back.
AWS names four strategies, cheapest first:
- Backup and restore: backups copied to another region; everything is rebuilt on demand.
- Pilot light: data replicated and live; servers defined but switched off.
- Warm standby: a scaled-down copy that already works.
- Multi-site active-active: every region serves users.
RPO comes from Replication. Asynchronous cross-region replication loses the lag, usually seconds. Synchronous replication gives RPO 0, but every write waits for another region.
Failover moves traffic and promotes the replica. Automate the steps but let a human start them: a false alarm also costs downtime and data. Failback means resyncing the old primary first.
Replication is not backup: a bad delete replicates in seconds. Keep point-in-time backups, and rehearse restores and failovers in scheduled game days.
Real example
GitLab.com, 31 January 2017. While repairing replication, an engineer wiped the data directory on the primary database, believing it was the secondary. The daily pg_dump backups had been failing silently (a version mismatch, and the alert emails were rejected), so the backup bucket was empty. What saved them was a snapshot an engineer had taken by hand ~6 hours earlier.
Outcome: ~6 hours of data lost (~5,000 projects, ~700 new users) and more than 18 hours of downtime.
Trade-offs +3 · −3
+ You gain
- Turns "the region is gone" from an existential event into a rehearsed procedure.
- RPO and RTO give the business a price list: each tier's cost against the loss it avoids.
- Regular failovers also catch configuration drift, missing quotas and stale runbooks.
− You pay
- Cost climbs steeply: active-active pays for full capacity in two or more regions.
- Multi-region writes bring either conflicts to resolve or cross-region latency on every write.
- The recovery path rots unless you exercise it; untested DR is a false sense of safety.
Use it when
Any system whose outage or data loss has a price. Set RPO and RTO per workload: backups for everything, a standby region only where downtime costs more than the standby.
Avoid it when
Don't pay for multi-region when several availability zones in one region already meet the targets, or when the recovery plan costs more than the outage it prevents.
Numbers to know 5
- AWS Well-Architected (checked Nov 2026): backup and restore = RPO hours, RTO up to a day; pilot light = RPO minutes, RTO tens of minutes.
- Same source: warm standby = RPO seconds, RTO minutes; multi-site active-active pushes both toward zero.
- Aurora Global Database (AWS, checked Nov 2026): asynchronous cross-region replication, typically under 1 s behind; a secondary is promoted in under a minute.
- DynamoDB global tables (checked Nov 2026): the default mode is asynchronous (RPO of a few seconds); the strong-consistency mode is synchronous (RPO 0) and needs exactly three regions.
- GitLab, Jan 2017: ~6 h of data lost and more than 18 h down after backups had been failing silently.
Common pitfalls 4
- Calling replication a backup: corruption and accidental deletes replicate within seconds.
- Never restoring a backup until the day you need it, and finding the job failed for months.
- A standby region without the capacity, quotas or configuration to take full load: drift nobody noticed.
- Fully automatic region failover on a noisy health check: a false alarm causes the downtime and data loss it was meant to avoid.
Interview questions 3
Answer out loud first, then reveal.
How do you choose a DR strategy for a new system?Show answer
I start from the business: what does an hour of downtime cost, and what does an hour of lost data cost? That gives an RTO and an RPO per workload, not one number for everything. Then I pick the cheapest tier that meets them: backups for internal tools, warm standby for revenue paths, active-active only when minutes of downtime are unacceptable. And I budget the drills, because an untested tier delivers nothing.
The business asks for RPO zero across regions. What does it cost?Show answer
RPO zero means a write isn't acknowledged until another region has it, so replication must be synchronous. Every write pays a cross-region round trip, and when regions can't talk I must choose: refuse writes or break the promise. In practice I use a consensus-based store across three regions for the data that truly needs it, and asynchronous replication with seconds of RPO for the rest.
Why keep backups if you already replicate to another region?Show answer
They protect against different failures. Replication covers losing a site: the copy is seconds behind. But it copies everything faithfully, including a bad migration, a bug that corrupts rows or an attacker's delete. Only a point-in-time backup lets me go back to before the mistake. So I keep both, store backups in another account and region, and restore them on a schedule to prove they work.