StackPractices
advanced By Mathias Paulenko

Disaster Recovery: RTO, RPO, and Resilient Recovery Runbooks

A practical guide to disaster recovery planning: defining RTO and RPO, backup strategies, multi-region failover, and building recovery runbooks that minimize downtime.

Overview

Disaster recovery (DR) is the set of policies, tools, and procedures that bring business-critical systems back after a natural or human-induced disaster. When a region dies or a database corrupts, DR is what decides whether you lose minutes or the business.

Here is a hands-on guide to defining recovery objectives, backup strategies, multi-region architectures, and useful runbooks.

When to Use

  • You operate a business-critical service where downtime is unacceptable
  • You need to comply with regulatory requirements for data protection
  • You want to protect against cloud provider outages, region failures, or data corruption
  • You are designing or reviewing your backup and recovery strategy
  • You need to define RTO and RPO targets for your organization

Once the strategy exists, the disaster recovery plan template turns it into a signable document, and the test plan schedules the drills that keep it honest.

Core Concepts

ConceptDescriptionTypical Values
RTO (Recovery Time Objective)Maximum acceptable downtime after a disasterMinutes to 24 hours
RPO (Recovery Point Objective)Maximum acceptable data loss (time since last backup)Zero to 24 hours
MTTR (Mean Time to Recovery)Average time to restore service after failureMeasured in minutes/hours
MTBF (Mean Time Between Failures)Average time between system failuresMeasured in days/months
FailoverSwitching to a standby system when primary failsAutomatic or manual
FailbackReturning to the primary system after recoveryPlanned and tested

Disaster Recovery Strategies

StrategyRTORPOCostDescription
Backup and RestoreHours to daysHours to daysLowPeriodic backups restored to new infrastructure
Pilot Light10-60 minutesMinutesMediumCore systems always running; scale up on demand
Warm StandbyMinutesNear-zeroMedium-HighScaled-down replica ready to scale up
Hot Standby / Active-ActiveNear-zeroNear-zeroHighFull replica actively serving traffic
Multi-Region Active-ActiveNear-zeroZeroVery HighAll regions serve traffic simultaneously
Mermaid flowchart TD diagram

The spectrum is also a budget axis: every step to the right buys lower RTO/RPO with higher infrastructure and operational cost.

Step-by-Step DR Planning

1. Define Recovery Objectives

Set RTO and RPO for each critical system:

# Example: Recovery objectives by service tier
tiers:
  - name: tier_1_critical
    examples: [payment-processing, user-authentication]
    rto: "5 minutes"
    rpo: "0 minutes"
    strategy: "active-active"
  - name: tier_2_important
    examples: [reporting, analytics]
    rto: "4 hours"
    rpo: "1 hour"
    strategy: "warm-standby"
  - name: tier_3_standard
    examples: [internal-tools, staging]
    rto: "24 hours"
    rpo: "24 hours"
    strategy: "backup-restore"

2. Map Dependencies and Critical Paths

Understand what must recover in what order:

# Example: Service dependency graph for recovery ordering
# Recovery must happen in dependency order:
# 1. DNS / CDN
# 2. Load balancers / API gateways
# 3. Databases (primary first)
# 4. Caching layers
# 5. Application services
# 6. Background workers
# 7. Analytics / batch jobs

Dependency Mapping Checklist

  • Identify single points of failure
  • Map database replication topologies
  • Document external API dependencies
  • Note critical third-party services
  • Verify backup systems are independent of primary

3. Design Backup Strategy

Match backup frequency and retention to RPO requirements:

Data TypeBackup FrequencyRetentionStorage
Transactional databaseContinuous or hourly30 days + annualCross-region + cold storage
File/object storageDaily sync90 daysCross-region
Configuration/IaCEvery change (Git)ForeverGit + artifact store
LogsReal-time streaming30-90 daysHot + cold tiers
# Example: PostgreSQL backup strategy
# Continuous archiving (WAL) for point-in-time recovery
cat <<EOF >> postgresql.conf
archive_mode = on
archive_command = 'aws s3 cp %p s3://my-backups/wal/%f'
wal_level = replica
EOF

# Daily base backup
pg_basebackup -D /backups/$(date +%Y%m%d) -Ft -z -P

4. Implement Multi-Region Architecture

Design for regional failure from the start:

# Example: Multi-region active-passive Kubernetes
# Primary region: us-east-1
# Secondary region: us-west-2

apiVersion: apps/v1
kind: Deployment
metadata:
  name: api-service
spec:
  replicas: 3
  template:
    spec:
      affinity:
        podAntiAffinity:
          preferredDuringSchedulingIgnoredDuringExecution:
            - weight: 100
              podAffinityTerm:
                labelSelector:
                  matchLabels:
                    app: api-service
                topologyKey: topology.kubernetes.io/zone

Multi-Region Patterns

  • Read replicas: Primary region writes; secondary regions read replicas
  • Active-passive: Primary active; secondary on standby (pilot light or warm)
  • Active-active: Both regions serve traffic (requires data synchronization)
  • Cell-based: Sharded architecture with cells in multiple regions

5. Create Recovery Runbooks

Document step-by-step recovery procedures:

# Runbook: Database Failover to Secondary Region

## Trigger
- Primary region database health check fails for >2 minutes
- Automatic alert fires: `database-primary-down`

## Steps

1. **Verify outage** (1 min)
   - Check monitoring dashboard
   - Confirm region-level issue (not isolated instance)

2. **Initiate failover** (2 min)
   - Run: `kubectl exec failover-script -- promote-replica`
   - Verify: new primary accepts writes

3. **Update DNS** (2 min)
   - Switch database CNAME to secondary region
   - TTL: 60 seconds (pre-configured)

4. **Verify application health** (3 min)
   - Check application error rates
   - Verify critical user flows

5. **Communicate** (5 min)
   - Update status page
   - Notify stakeholders

## Rollback
- When primary recovers, plan failback during maintenance window
- Validate data consistency before failback

Once the runbooks exist, the disaster recovery plan template packages them with RTO/RPO targets, contact trees, and a testing schedule into a document the whole team can sign off on.

6. Test Recovery Regularly

A DR plan nobody has run is a document, not a plan:

Test TypeFrequencyScope
Tabletop exerciseQuarterlyWalk through runbooks without executing
Backup restore testMonthlyRestore database from backup to verify integrity
Failover drillQuarterlyPromote replica, update DNS, verify service
Chaos engineeringMonthlyInject failures (e.g., terminate primary database)
Full DR simulationAnnuallySimulate complete region failure and recovery
# Example: Automated backup integrity check
import subprocess

def test_backup_restore():
    latest_backup = get_latest_backup()
    temp_instance = create_temp_database()
    
    restore_result = subprocess.run([
        'pg_restore',
        '--dbname', temp_instance.connection_string,
        latest_backup.path
    ], capture_output=True)
    
    if restore_result.returncode != 0:
        alert_oncall("Backup restore test failed!")
        return False
    
    # Verify row counts match expected values
    rows = temp_instance.query("SELECT count(*) FROM critical_table")
    assert rows[0][0] > 0, "Restored database appears empty"
    
    cleanup(temp_instance)
    return True

What Works

  • Automate where possible. Manual failover at 3 AM is error-prone.
  • Keep runbooks simple. A stranger on-call at 3 AM should be able to run them.
  • Test backups by restoring. A backup you can’t restore isn’t a backup.
  • Monitor replication lag. If lag exceeds RPO, alert immediately.
  • Document assumptions. What if DNS is down? What if the runbook author is unavailable?
  • Separate DR infrastructure. DR systems should not depend on primary region resources.

Common Mistakes

  • Untested backups. Many organizations discover corrupted backups only during a real disaster.
  • Over-engineering for low-tier systems. Match DR strategy to business criticality.
  • Forgetting about data consistency. Asynchronous replication can lose transactions during failover.
  • Ignoring runbook maintenance. A runbook that references decommissioned tooling makes a bad night worse.
  • No communication plan. When everything is on fire, nobody wants to write status updates — schedule them anyway.

Variants

  • Cloud-native DR: Use managed services with built-in replication (RDS Multi-AZ, Azure Site Recovery, Cloud SQL replicas).
  • On-premise DR: Focus on off-site tape backups, warm sites, and hardware procurement timelines.
  • Hybrid DR: Cloud-based DR for on-premise workloads (reverse pilot light).

When NOT to Invest in DR

  • Single internal tool with tolerant users. If a wiki can be down for a day, backup-and-restore is enough. Active-active would burn budget for nothing.
  • Stateless services behind a queue. Workers that pull from a durable queue recover on their own once the queue is back; they rarely need a dedicated failover runbook.
  • Pre-product prototypes. DR planning before product-market fit optimizes for a disaster that may never matter. A nightly backup plus a one-page restore note covers it.
  • When the real risk is elsewhere. If your last three outages were bad deploys, fix the deploy pipeline first. DR doesn’t protect against self-inflicted incidents; a blue-green deployment or feature-flag rollback does.

Worked Example: Payments Platform, One Region Down

A payments team runs on AWS with us-east-1 as primary and us-west-2 warm standby. Tier 1 services (payment processing, auth) get RTO 5 min / RPO 0 via a synchronous replica; tier 2 (reporting) gets RTO 4 h via backup-restore.

At 14:32, every health check in the primary region goes red. The on-call engineer opens the database failover runbook: confirm it’s a regional issue, promote the us-west-2 replica (2 min), flip the CNAME (TTL 60 s), verify error rates on the payment flow, and post a status update. Total downtime: 11 minutes, inside the 5-minute RTO only because the alert fired at 14:36 — the gap between failure and detection counts against RTO too.

The lesson from the postmortem: their last drill was a tabletop exercise, and nobody had actually run promote-replica in six months. They moved failover drills to quarterly with real execution, which is what the test plan formalizes.

See Also

Conclusion

Disaster recovery is insurance for your infrastructure. Set objectives you can afford, pick the strategy that matches them, write the runbook, then actually run it. The time to discover a problem with your DR plan is during a drill, not during a real disaster.

Frequently Asked Questions

How do I choose RTO and RPO targets?

Balance cost against business impact, per tier. A trading platform needs seconds; an internal wiki tolerates hours. Start from the business: what does one hour of downtime or one hour of lost data actually cost? That number sets the ceiling for what you can spend shrinking it.

What is the minimum viable DR strategy?

Automated daily backups shipped to a different region, a monthly restore test that proves the backups work, and a one-page runbook that names who does what. That trio covers most small-team disasters for near-zero ongoing cost.

What is the difference between backup and replication?

A backup is a point-in-time copy you restore manually; it defines your RPO floor (hours). Replication streams changes continuously to a live copy; it defines your RTO floor (minutes). Replication without backups still loses to corruption and accidental deletes — a replicated DROP TABLE is replicated everywhere. Mature DR uses both.

How do I handle database failback after recovery?

Plan it during a low-traffic window. Sync the recovered primary with writes that happened on the replica during the outage, validate consistency with row counts and checksums, then re-point traffic. Never fail back without comparing data first — the "recovered" region is sometimes missing the transactions that mattered most.

How often should we run DR drills?

Restore tests monthly, failover drills quarterly, a full regional-failure simulation annually. Frequency matters less than actually executing: a drill where someone runs the real commands beats four tabletop walkthroughs.

Should I use the same cloud provider for DR?

Multi-region on one provider covers region failure, the most common disaster. Multi-cloud adds resilience against provider-wide incidents but roughly doubles your operational surface. Most teams get more out of mastering single-provider multi-region first.