What it is
Disaster recovery (DR) is the plan and machinery for restoring service after an event that takes out more than redundancy within a site can absorb: a region outage, a destroyed database, a ransomware attack, an operator deleting production data. It is measured by two objectives:
- RPO (recovery point objective): the maximum acceptable data loss, measured in time. "RPO 5 minutes" means losing at most the last five minutes of writes.
- RTO (recovery time objective): the maximum acceptable time from the disaster until the service works again.
Why it exists
High availability inside one region (multiple zones, replicas, failover) handles common failures. It does not help when the region itself is unavailable, when the failure is logical (a bad migration replicates everywhere in milliseconds), or when an attacker encrypts or deletes data. DR covers those cases, usually with a second region and backups kept apart from production.
How it works
Data: replicas and backups. Asynchronous cross-region replication keeps a copy seconds behind: the RPO for losing a region is roughly the replication lag. But replicas apply every change, including the wrong ones. Backups are point-in-time copies: periodic snapshots plus continuously archived transaction logs allow point-in-time recovery to just before a bad change. Keep them in a separate account and region, immutable (object lock, retention policies), and test restores. Restore time grows with data size, so backups alone mean long RTOs.
Compute and traffic. A global traffic manager (DNS failover with health checks, anycast, or a global load balancer) sends users to a healthy region. Region-level health checks and the traffic manager's own detection time are part of the RTO, plus clients caching DNS answers.
Strategies, from cheapest to most expensive:
| Strategy | What runs in the recovery region | Typical RPO | Typical RTO |
|---|---|---|---|
| Backup and restore | Nothing; backups stored there | Since last backup / log segment | Hours |
| Pilot light | Replicated data; compute off | Seconds–minutes (replication lag) | Tens of minutes or more |
| Warm standby | Data plus a scaled-down full stack | Seconds–minutes | Minutes |
| Active-active | Full stack serving live traffic | Near zero to seconds | About detection time |
(Ranges are illustrative orders of magnitude; your numbers come from your drills.)
When to use it
Every production system needs at least backup and restore with tested restores. Choose higher tiers per system from the business cost of downtime and data loss: a payment API may justify active-active; an internal reporting tool may be fine with restoring from backup within a day.
When not to
- Do not buy active-active for systems whose RTO target is hours: it adds multi-region data complexity for nothing.
- Do not count replicas as backups, or backups in the same account and region as off-site protection.
- Do not design a DR tier you will not rehearse: an untested plan gives a false sense of safety.
Trade-offs
| Choice | You gain | You pay |
|---|---|---|
| Async cross-region replication | Small RPO for region loss, no write latency | Loses the lag on failover; replicates mistakes |
| Sync cross-region replication | RPO ≈ 0 for region loss | Cross-region round trip on every write |
| Warm standby over pilot light | Shorter RTO, a tested running stack | Paying for idle capacity |
| Active-active | RTO ≈ detection, capacity in use | Double capacity, multi-region writes and conflicts |
| Immutable off-site backups | Survive ransomware and account compromise | Storage cost, slower restores |
Alternatives
- Multi-zone high availability inside one region covers most outages with far less complexity; DR adds region-level and logical protection on top.
- Cell-based architecture: split users into independent cells so a disaster hits only a fraction of them.
- Globally distributed databases with consensus replication across regions make region failover a database feature, at the cost of write latency.
Failure modes
- Restore never tested: backups exist but are corrupt, incomplete, or take ten times longer to restore than assumed.
- Shared fate: backups in the same account that the attacker or the bad script also reached.
- Undersized recovery region: traffic moves, then the survivor collapses under the full load.
- Hidden single-region dependencies: identity provider, secrets, container registry or DNS control plane living only in the failed region.
- Configuration drift: the standby region runs an old version or misses a migration.
- Failing back: returning to the original region is a second migration with its own risks.
In production
Write RPO and RTO per system and get them agreed with the business. Automate the failover runbook as far as possible, keep it in version control, and run DR drills on a schedule: restore a backup into an empty account, fail a region on purpose, and time every step. Monitor replication lag against the RPO, backup success and age, and the capacity headroom of the recovery region. Keep a copy of the tooling needed for recovery (credentials, infrastructure code, runbooks) reachable when the primary region is not.
Common misconceptions
- "We replicate to another region, so we have backups." Replicas copy deletions and corruption.
- "RTO is how long the failover script runs." It includes detection, decision, scaling the recovery region, traffic shifting and client caches.
- "Active-active means no outage." Requests in flight to the failed region still fail until it is detected and drained, and the survivor must have capacity for everything.
- "Cloud providers handle DR." They provide building blocks; the plan, the drills and the data protection are yours.
Interview angle
State RPO and RTO targets early, then pick the cheapest strategy that meets them and justify it. Distinguish replication (region loss) from backups (logical errors). For multi-region designs, explain how traffic fails over, how long detection takes, whether the surviving region has capacity, and how writes work across regions. Mentioning immutable off-site backups and regular DR drills signals real operational experience.
Model assumptions
The engine runs traffic, region failures, health checks and replication; the backups step is a scripted illustration because the backup vault has no simulation model. Users send 120 req/s (Poisson, 20% writes). The traffic manager probes each region's load balancer every 1 s (3 failures eject, 2 successes restore); regional balancers probe app servers every 500 ms. Each app server has 6 workers and a 50 ms mean service time (about 90 req/s with its database call). DB A replicates to DB B asynchronously with about 0.4 s of lag. A region failure is all its nodes failing at once. Strategies differ only in what runs in Region B beforehand and when the rest is started or scaled; in the active-active step Region B's apps write to DB B and the model does not resolve cross-region write conflicts. Times are compressed: a simulated second stands for minutes in a real DR event. Numbers are illustrative, not benchmarks.