Module 6 · Reliability and infrastructureLesson 66 of 887 minIntermediate
Disaster recovery
Disaster recovery is the plan for losing a whole data centre or region. Two numbers define it, how long you're down (RTO) and how much data you lose (RPO).
Play each strategy and compare the two stats. Notice how cost (how much runs in the second region) relates to recovery time.
Redundancy inside one data centre protects against single machines failing. Disaster recovery (DR) is for bigger events: a whole region down, a fire, a flood, a cloud provider outage, or a catastrophic mistake.
The two numbers
- RTO (recovery time objective): how quickly must service be back?
- RPO (recovery point objective): how much recent data can be lost?
Agree these with the business first. They decide everything else, including the cost.
Four common strategies
| Strategy | What runs in region 2 | RTO | RPO | Cost |
|---|---|---|---|---|
| Backup & restore | Only backups | Hours to days | Hours | Lowest |
| Pilot light | Database replica only | Tens of minutes | Seconds to minutes | Low |
| Warm standby | Small, full copy of the stack | Minutes | Seconds | Medium |
| Active-active | Full production, serving users | Near zero | Near zero | Highest |
What makes DR work
- Infrastructure as code (Terraform, CloudFormation): rebuilding a region is running a script, not a week of clicking.
- Data replicated or backed up to another region, ideally another account too, so a single compromised account can't delete both.
- Runbooks: step-by-step instructions, and clear authority to declare a disaster.
- DNS and traffic management that can shift users between regions.
- Drills: regular failover exercises. Untested DR plans fail, usually on something small like an expired certificate or a forgotten secret.
Don't forget dependencies
Your recovery is only as fast as the slowest thing you depend on: third-party APIs, a single-region identity provider, a config service. Map them before the disaster, not during.