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).

Try it

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

StrategyWhat runs in region 2RTORPOCost
Backup & restoreOnly backupsHours to daysHoursLowest
Pilot lightDatabase replica onlyTens of minutesSeconds to minutesLow
Warm standbySmall, full copy of the stackMinutesSecondsMedium
Active-activeFull production, serving usersNear zeroNear zeroHighest

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.

Quick check

A business can tolerate 15 minutes of downtime and no more than a few seconds of lost data. Which strategy fits?