Availability, failover and disaster recovery¶
What you'll be able to do¶
- Translate "nines" of availability into downtime you can plan for.
- Explain failure domains (host, availability zone, region) and why Multi-AZ is not disaster recovery.
- Choose between backup/restore, pilot light, warm standby and active/active using RTO, RPO and cost.
Availability in numbers¶
Availability is the fraction of time the system works. Each extra "nine" cuts allowed downtime by 10×.
| Target | Downtime per year | Per month (30 d) |
|---|---|---|
| 99% | 3.65 days | 7.2 hours |
| 99.9% | 8.76 hours | 43.2 minutes |
| 99.99% | 52.6 minutes | 4.3 minutes |
| 99.999% | 5.26 minutes | 26 seconds |
Chain services in series and availability multiplies: three dependencies at 99.9% each give about 99.7% overall. Redundancy in parallel helps: two independent 99.9% copies fail together only about 0.0001% of the time (if failures are truly independent, which is the hard part).
Failure domains¶
A failure domain is a set of things that fail together. Design so that losing one domain does not lose the service.
| Domain | Example failure | Typical protection |
|---|---|---|
| Process / host | Crash, bad deploy, hardware | Multiple instances behind a load balancer, health checks |
| Availability Zone (data centre) | Power or network loss in one data centre | Multi-AZ: spread instances and a standby database across AZs |
| Region | Regional outage, major disaster, bad regional config | Multi-region design (the rest of this lesson) |
| Logical | Bad migration, bug, deleted data, ransomware | Backups with point-in-time recovery (replication would copy the damage) |
Multi-AZ gives you high availability for the first three rows of failures inside one region. It does nothing if the whole region goes away.
Two numbers that drive every DR decision¶
- RTO (Recovery Time Objective): how long you can be down. "Back within 15 minutes."
- RPO (Recovery Point Objective): how much recent data you can lose. "At most 5 seconds of writes."
Shorter RTO and RPO cost more, and the relationship is steep. Ask the business for both numbers per system. Not everything needs five nines.
The four classic strategies¶
| Strategy | What runs in the recovery region | RTO | RPO | Cost |
|---|---|---|---|---|
| Backup & restore | Nothing; backups are stored copies | Hours | Hours (since last backup) | Lowest |
| Pilot light | Data replicated; infrastructure defined but compute at zero | Tens of minutes | Seconds–minutes | Low (pay for data, not compute) |
| Warm standby | Full stack running at reduced capacity | Minutes | Seconds | Medium (always-on small stack) |
| Active/active | Full stack serving real traffic in both regions | Near zero | Near zero | Highest (and most complex) |
Ranges are typical orders of magnitude; real numbers depend on your design and must be measured.
Key difference in practice¶
- Pilot light vs warm standby is a single number: whether the recovery region's capacity is 0 or small. Warm standby can also be tested continuously with synthetic traffic, because it is already running.
- Active/active is hard mostly because of data: two regions accepting writes means conflict handling or deciding which region owns which record. Options include write-local (fast, may lose a concurrent write), write-global (one writer region, others forward), or partitioning records by "home region".
Things that go wrong in real failovers¶
- Failure detection is hard. A simple ping can cause false alarms; failing over unnecessarily costs downtime and can lose data. Combine health checks with error rates, latency and business metrics.
- Failover that was never tested does not work. Practise it, automate it, time it.
- Replication is not backup. Keep independent point-in-time backups even with live replication.
- Failback (returning to the primary) is its own procedure and is easy to forget.
- Hidden dependencies: DNS, secrets, container registries, third-party APIs, or one shared service in the primary region can make a "fully replicated" region useless.
- Capacity: the recovery region must be able to absorb the full load when it takes over, so check quotas.
Interview angle
Start by asking for RTO and RPO. Then place the design on the cost/recovery line and justify the position. "Active/active everywhere" is usually the wrong answer because the cost and consistency trade-offs don't match the stated requirements.
For AI engineers¶
For AI engineers
Your training script may save a checkpoint every 30 minutes. If the training region disappears just before the next save, you can lose almost 30 minutes of work; that is the checkpoint's effective RPO. Copy checkpoints, datasets, model weights and experiment metadata to a separate region or recovery account, then test that you can actually resume from them. A model registry and secrets are dependencies too.
Restoring model serving needs more than copied weights: the recovery region needs enough GPU quota and capacity to start the fleet within your RTO. For a vector index, decide whether recovery means restoring a snapshot or rebuilding from source documents, and time both paths. Run a game day that simulates the primary region failing; measure data loss and time to serve a real request again.
Common mistakes¶
- Assuming capacity will appear on demand: check recovery-region compute and GPU quotas before declaring an RTO.
- Keeping backups beside the primary: a regional or account-level incident can make the backup unavailable too.
- Never restoring a backup: a successful backup job says little about whether the data and instructions are usable.
- Ignoring traffic-switch delay: a long DNS TTL can keep clients on the failed endpoint after the recovery stack is ready.
- Forgetting dependencies: secrets, registries and external services must work in the recovery region.
- Failing over on one bad ping: require sustained evidence from more than one health signal to reduce false alarms.
Check yourself¶
Your database runs Multi-AZ in one region. The business asks "are we protected against a regional outage?" What do you answer?
No. Multi-AZ protects against loss of one availability zone inside the region. Regional protection needs a copy of data and infrastructure in another region (at minimum cross-region backups, better replication plus a recovery stack).
A system must lose at most seconds of data but can be down for 20–30 minutes, and budget is tight. Which strategy fits and why?
Pilot light (or a minimal warm standby): continuous cross-region data replication keeps RPO in seconds, while compute stays off or minimal, so cost is low. The 20–30 minute RTO covers booting capacity and shifting traffic.
Why does a nightly backup alone not meet an RPO of 1 minute?
RPO is the maximum acceptable data loss. A nightly backup can lose up to 24 hours of writes. A 1-minute RPO needs continuous replication or frequent log shipping.
Lab¶
Build availability and recovery calculators in code/failover-dr/. Add a failover controller that waits for repeated bad health checks and supports manual approval. Choose a valid full-backup and log chain for point-in-time recovery. Check whether replication lag stays within an RPO. Run cd code/failover-dr && PYTHONPATH=starter python -m pytest tests -q.
Real systems that use this¶
The Multi-Region & DR chapter of your Atlas is almost exactly this lesson in diagrams: one case per strategy, plus a serverless variant and a managed DR service. Multi-AZ web-app cases are linked as the "single-region" baseline.
Go deeper¶
- Interactive: Designed to Scale – redundancy
- Your Atlas, ch. 8 (the comparison table at the end of the chapter)
- Reference: Google's SRE book (free), on SLOs and reliability
See it in the wild¶
Open these real architectures and find the idea in the diagram. Predict how it is used before you read the analysis.

Pilot Light

Warm Standby

Multi-site Active/Active

Backup/Restore đa Region: Phía Backup

Backup/Restore đa Region: Phía Restore

DR Active/Passive hướng Event-Driven, Serverless

AWS Elastic Disaster Recovery (DRS): DR như một Managed Service

Web Application Architecture "Cổ Điển" Multi-AZ
