The idea in one minute#
Disaster recovery (DR) is the plan for losing something big: a region, a data centre, an account, a critical vendor, or your data’s integrity. There are four standard strategies, in increasing cost and decreasing recovery time: backup and restore, pilot light, warm standby, and multi-site active-active. Pick per service, from its RPO and RTO and what an hour of downtime costs.
A DR plan is worth exactly what its last test proved. Plans that have not been exercised fail on details — expired credentials, missing quotas in the other region, a DNS TTL of a day, a runbook that assumes the primary region’s tooling is up.
An analogy#
A household’s plans for a house fire, in increasing cost: insurance and a box of documents at a relative’s house (backup and restore); a rented storage unit with the essentials (pilot light); a fully furnished second flat (warm standby); living in two houses at once (active-active).
A picture#
flowchart LR
subgraph S1["Backup & restore"]
B1["Region B: nothing running<br/><small>backups only</small>"]
end
subgraph S2["Pilot light"]
B2["Region B: data replicated,<br/>core infra off or minimal"]
end
subgraph S3["Warm standby"]
B3["Region B: full stack running<br/>at reduced size"]
end
subgraph S4["Active-active"]
B4["Region B: serving traffic<br/>at full size"]
end
S1 -->|"cheaper, slower"| S2 --> S3 -->|"costlier, faster"| S4
class B1 neutral
class B2 memory
class B3 queue
class B4 ioHow it really works#
The four strategies#
| Strategy | Recovery region has | RPO | RTO | Relative cost |
|---|---|---|---|---|
| Backup and restore | Backups (and IaC to build everything) | Hours (backup interval) | Hours to a day | Lowest |
| Pilot light | Data continuously replicated; app tier off or minimal | Seconds–minutes | Tens of minutes to hours | Low |
| Warm standby | A scaled-down but working copy of the full stack | Seconds–minutes | Minutes | Medium |
| Multi-site active-active | Full capacity, serving users | ~0 (with care) | Near zero | Highest (and the most complex data design) |
(These are the names AWS uses in its DR whitepaper; the ideas apply on any provider or on-premises.)
Active-active across regions is not just “more servers”: it needs a data design that tolerates two sites writing — per-region data ownership (cells, 7.c), conflict resolution, or a globally consistent database (Spanner, CockroachDB, Aurora DSQL-style designs) with its latency cost.
What a DR plan contains#
- Scope: which services, which disasters (region loss, account compromise, data corruption, vendor loss).
- Objectives: RPO and RTO per service, agreed with owners.
- Decision: who declares a disaster and triggers failover — a named role, with criteria. Failing over is itself risky; do not do it for a 10-minute blip.
- Order of recovery: dependencies first (identity, DNS, secrets, databases), then services in priority order.
- Runbooks for each step, runnable without the primary region — tooling, CI, secrets, and the runbooks themselves must be reachable from the recovery side.
- Capacity: quotas and instance capacity in the recovery region (a whole region failing over to yours at the same moment as everyone else’s).
- Failback: how to return, including re-syncing data written during the disaster.
- Communication plan (5.b).
- Test schedule and the results of the last test.
Static stability#
Design the recovery path so it does not need the failed region’s control plane. If failing over requires calling an API in the region that is down — to change DNS, scale a group, or read a secret — the plan fails. Pre-provision, pre-authorise, and prefer data-plane mechanisms (health- checked DNS failover, anycast, already-running standby capacity) over control-plane actions at the moment of disaster.
Testing DR#
| Test | What it proves |
|---|---|
| Tabletop walk-through | The plan is complete and people know their roles |
| Component failover (one database, one service) | That component’s runbook works |
| Full failover of a non-production environment | The whole sequence works and how long it takes |
| Production failover (planned, during low traffic) | The real thing works — the only proof |
Google’s annual DiRT (Disaster Recovery Testing) exercises — taking down whole data centres, or making key people unavailable — are the best-known example (10.c).
A worked example#
A company has three services:
| Service | RPO | RTO | Cost of an hour down |
|---|---|---|---|
| Storefront + checkout | 1 min | 15 min | $200,000 |
| Internal reporting | 24 h | 2 days | $2,000 |
| Customer support tool | 15 min | 4 h | $10,000 |
Choices:
- Checkout: warm standby in a second region — database replica, app tier at 30% size with autoscaling allowed to 100%, health-checked DNS failover with a 60-second TTL. Annual test.
- Reporting: backup and restore — nightly warehouse snapshots copied cross-region; IaC to rebuild.
- Support tool (a SaaS vendor): a review of the vendor’s own DR commitments in the contract, plus a pilot light of its own: ticket data streamed every few minutes from the vendor’s export API into the company’s storage, and a minimal read-only viewer that can be scaled up if the vendor is lost.
The first full production failover test of checkout takes 41 minutes instead of 15, because the standby region’s quota allowed only 40% of the needed instances and the increase needed a support ticket. Fixed in advance, the second test takes 12.
The program picks the cheapest strategy that meets each service’s RPO and RTO, and compares the yearly cost of the strategy with the expected cost of downtime.
Code#
// dr.go — choose the cheapest DR strategy that meets RPO and RTO, and compare with expected loss.
package main
import (
"fmt"
"time"
)
type strategy struct {
name string
rpo, rto time.Duration
costPerY float64 // yearly cost for a service of "unit" size
}
type service struct {
name string
rpo, rto time.Duration
sizeFactor float64 // multiplier on strategy cost
lossPerH float64 // cost of an hour of downtime
}
func main() {
strategies := []strategy{
{"backup & restore", 24 * time.Hour, 24 * time.Hour, 5_000},
{"pilot light", 5 * time.Minute, 2 * time.Hour, 20_000},
{"warm standby", time.Minute, 15 * time.Minute, 60_000},
{"active-active", 0, time.Minute, 180_000},
}
services := []service{
{"storefront + checkout", time.Minute, 15 * time.Minute, 3, 200_000},
{"internal reporting", 24 * time.Hour, 48 * time.Hour, 1, 2_000},
{"support data export", 15 * time.Minute, 4 * time.Hour, 0.5, 10_000},
}
const regionLossPerYear = 0.1 // chance a year of a region-scale disaster lasting a day
for _, s := range services {
fmt.Printf("%s (RPO %v, RTO %v)\n", s.name, s.rpo, s.rto)
chosen := ""
for _, st := range strategies {
meets := st.rpo <= s.rpo && st.rto <= s.rto
cost := st.costPerY * s.sizeFactor
// Expected yearly downtime loss if a region disaster happens: RTO hours × loss/h × probability.
expLoss := regionLossPerYear * st.rto.Hours() * s.lossPerH
mark := " "
if meets && chosen == "" {
chosen = st.name
mark = "→ "
}
fmt.Printf(" %s%-18s meets=%-5v cost $%8.0f/y expected outage loss $%9.0f/y\n",
mark, st.name, meets, cost, expLoss)
}
if chosen == "" {
fmt.Println(" no strategy meets the objectives — revisit them with the owner")
}
fmt.Println()
}
}Read each block from the arrow down: the arrow marks the cheapest strategy that meets the objectives. For checkout, the expected-loss column also shows why the objectives were right — backup and restore would be cheap to run and ruinous in a disaster.
Remember this#
- Four strategies: backup & restore, pilot light, warm standby, active-active — cost against RPO/RTO.
- Choose per service, from its objectives and the cost of downtime.
- The plan names who declares a disaster, the recovery order, runbooks that work without the primary region, capacity and quotas, and failback.
- Design for static stability: the recovery path must not depend on the failed control plane.
- The plan is worth what its last test proved — test in production when you can.
Try it#
- Run
dr.go. Change checkout’s RTO to 1 hour. Which strategy is chosen now, and is the expected loss acceptable? - Write the “order of recovery” list for a system you know. What must come back first?
- Check whether your recovery region has the quota for a full failover today.
Check yourself#
- What is the difference between pilot light and warm standby?
- Why does active-active need a data design, not just more servers?
- What is static stability, and why does it matter during a region failure?
- Name three things that commonly break during a first DR test.