Reliability targets Updated

RTO vs RPO

The recovery time objective (RTO) is the longest a service may stay down after a disruption. The recovery point objective (RPO) is how much data, measured in time, you can afford to lose. RTO looks forward from the failure; RPO looks back from it. Set both per service and per data store, then prove them with tests.

On this page
  1. The two objectives
  2. How they relate to SLOs
  3. Recovery examples
  4. Disaster recovery patterns
  5. Setting and proving targets

last recovery point ←— RPO —→ disruption ←— RTO —→ service restored

The two objectives

AspectRTORPO
QuestionHow long until the service works again?How much recent data can we lose?
MeasuredFrom the interruption of service to its restorationBack from the interruption to the last point you can recover to
Driven byDetection, the decision to recover, failover or restore time, and verificationBackup frequency, replication lag, and how long corruption goes unnoticed
Reduced byStandby capacity, automation, rehearsed runbooksMore frequent backups, continuous replication, point-in-time recovery
Near zero needsA full-capacity standby that takes traffic within moments (hot standby), or serving from more than one site at once (active/active)Synchronous or low-lag replication, plus backups for corruption

Both are objectives, set before anything fails. What you actually achieve in a test or an incident is a measurement to compare against them. RTO is also not MTTR: MTTR is an average over past incidents, while an RTO is a limit for each disruption it covers.

How they relate to SLOs

Google Cloud’s disaster recovery guide says RTO and RPO are measurable and should be treated as SLOs. They answer a different question from an availability SLO. The SLO limits total unreliability across a window; the RTO limits a single disruption. Check that the two are consistent.

A 99.9% availability SLO allows 43m 12s of full outage per 30 days and 8h 45m 58s per year (see the availability table). One outage that lasts a 4-hour RTO spends 5.56 times the 30-day budget, so with a 30-day window a single such disaster breaks the SLO. Against a yearly window it uses 45.6% of the budget, and the SLO holds only if all other outages that year fit in the rest. If you accept that rare disasters will break a 30-day SLO, say how your error budget policy handles them. Otherwise, the recovery has to be much faster.

Recovery examples

Each example uses illustrative inputs. Replace them with figures measured on your own systems.

Bad migration deletes rows in the main database

The database takes a nightly full backup and archives its write-ahead log to object storage continuously, so it supports point-in-time recovery. A migration deletes rows at 14:00 and is noticed at 14:20.

A region is lost

The database replicates asynchronously to a second region, where a scaled-down copy of the application runs.

StepTime
Detect: the burn-rate page fires and is acknowledged5m
Decide: confirm the region is lost and authorise failover10m
Promote the replica and scale up the standby application tier10m
Shift traffic: DNS change, waiting out a 5-minute TTL5m
Recovery time30m

Corruption or deletion copied to every replica

A bug or an attacker corrupts records. Replication copies the bad writes to every replica within seconds, so the replicas are no help. Recovery has to come from a backup taken before the corruption began.

Stateless services and derived data

Disaster recovery patterns

AWS describes four broad patterns. Lower RTO and RPO cost more to run and are more complex to operate.

PatternWhat runs in the recovery siteRTORPO
Backup and restoreBackups only; infrastructure is redeployed during recoveryLongest: redeploy, then restore dataTime since the last backup
Pilot lightReplicated data stores; application servers are defined but switched offShorter: start and scale the applicationReplication lag
Warm standbyA scaled-down but working copy of productionShorter still: scale up and shift trafficReplication lag
Multi-site active/activeFull production, serving trafficNear zero for the loss of a siteNear zero with low-lag replication

Every pattern still needs point-in-time backups. Replication alone does not protect against corruption or deletion, and for those even active/active has a non-zero recovery time and recovery point.

Setting and proving targets

Sources: Google, Site Reliability Engineering, ch. 26 “Data Integrity: What You Read Is What You Wrote”; Google Cloud, Disaster recovery planning guide; PostgreSQL, Continuous Archiving and Point-in-Time Recovery; AWS, Disaster Recovery of Workloads on AWS (recovery objectives and disaster recovery options).