Skip to content
Tutorials Center
My learning

Topics

Lesson 56 of 70 ยท Architecture

High Availability and Disaster Recovery

Learn high availability and disaster recovery on AWS: Multi-AZ vs multi-Region, RTO and RPO, backup and restore, pilot light, warm standby and active-active, with runnable calculators.

Things break. A disk fails, a deployment goes wrong, an Availability Zone loses power, and once in a long while an entire Region has a bad day. Reliability on AWS does not mean preventing every failure. It means designing so that failures are small, recovered quickly and tolerated by the people using your system.

Two ideas cover most of this topic. High availability (HA) keeps the system running through common failures such as a dead instance or a lost Availability Zone, usually with no human involved. Disaster recovery (DR) is the plan for rare, large failures (a lost Region, corrupted data, a destroyed account) where you restore service from somewhere else. This lesson covers how to measure both, the standard DR strategies and the cost of each. It builds on the Well-Architected reliability pillar.

Failover and restores need real infrastructure, so the console steps and CLI commands in this lesson are read-only. The runnable examples are Python calculators: an availability calculator for redundant components and a DR strategy chooser with a data-loss simulation. The numbers are illustrations of the maths and typical ranges, not guarantees from AWS.

Measuring: availability, RTO and RPO

Availability is the fraction of time a system works, often written as "nines".

Availability Downtime per year
99% about 3.65 days
99.9% about 8.8 hours
99.99% about 52.6 minutes
99.999% about 5.3 minutes

Each extra nine is roughly ten times harder and more expensive. Ask what the business needs. A blog does not need five nines.

Two numbers define a DR plan.

  • RTO (Recovery Time Objective): how long you can be down. "We must be serving again within 30 minutes."
  • RPO (Recovery Point Objective): how much recent data you can afford to lose, measured in time. "We can lose at most 5 minutes of orders."

RTO is about the clock after the failure; RPO is about the age of the last copy of your data. They are independent: a system that restarts in 2 minutes (small RTO) but only backs up nightly (RPO of 24 hours) still loses a day of data. Both are business decisions with a price tag, so agree on them with the owners of the application before choosing a technology.

flowchart LR
    A["Last good<br/>copy of data"] -->|"RPO: data lost"| B["Disaster"]
    B -->|"RTO: time down"| C["Service<br/>restored"]

RPO looks back from the disaster to the last good copy; RTO looks forward to recovery.

High availability inside a Region

An Availability Zone (AZ) is one or more data centers with independent power and networking. A Region has several, connected by fast links. The foundation of HA is spreading each tier across at least two AZs.

  • Compute: run instances or containers in an Auto Scaling group that spans subnets in several AZs, behind an Elastic Load Balancer that sends traffic only to healthy targets.
  • Databases: RDS Multi-AZ keeps a synchronous standby in another AZ and fails over automatically, typically within a minute or two. Aurora stores six copies of the data across three AZs.
  • Storage: S3 and DynamoDB are already spread across AZs by AWS. A single EBS volume lives in one AZ, so protect it with snapshots.
  • Networking: put a NAT gateway in each AZ if you want private subnets to keep working when one AZ is lost.
flowchart TD
    U["Users"] --> L["Load balancer"]
    L --> A1["App tier<br/>AZ a"]
    L --> A2["App tier<br/>AZ b"]
    A1 --> D1["Database primary<br/>AZ a"]
    A2 --> D1
    D1 -. "synchronous<br/>replication" .-> D2["Database standby<br/>AZ b"]

A Multi-AZ web stack: losing either AZ leaves a working path.

Multi-AZ is not a backup. If someone drops a table, the standby drops it too, because replication copies mistakes quickly. For that, you need point-in-time recovery and backups, covered below.

Why redundancy raises availability

Components in a chain (series) all have to work: multiply their availabilities, and the result is lower than the weakest link. Redundant copies (parallel) fail only if all copies fail at once: multiply the failure probabilities. The formula for n independent copies is 1 - (1 - a)^n. Real failures are not perfectly independent (a bad deploy hits every copy), so treat the result as an upper bound.

Python Availability of series and parallel components

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Adding a second copy gives the biggest jump (from about 53 hours to about an hour a year), and each extra copy buys less: a third app copy barely helps once the database pair and the load balancer are the limit. AWS runs the load balancer across AZs for you for the same reason. Notice also what the model ignores: failover time, shared failures such as bad deployments, and capacity (each remaining AZ must be able to carry the full load, so plan for N+1).

Backups and point-in-time recovery

Backups protect against what replication cannot: deletion, corruption, ransomware and bad code.

  • AWS Backup schedules and stores backups for EBS, RDS, DynamoDB, EFS and more in one policy, with retention rules and copies to another account or Region (see Systems Manager and operations).
  • RDS automated backups with point-in-time recovery let you restore to any second within the retention window.
  • S3 versioning and Object Lock protect objects from overwrite and deletion (S3 security).
  • Keep at least one copy in a separate account, so a compromised account cannot erase all copies (multi-account governance).
Terminal
# Read-only examples
aws backup start-backup-job --backup-vault-name prod-vault \
  --resource-arn arn:aws:rds:eu-west-1:123456789012:db:orders \
  --iam-role-arn arn:aws:iam::123456789012:role/BackupRole

aws rds restore-db-instance-to-point-in-time \
  --source-db-instance-identifier orders \
  --target-db-instance-identifier orders-restored \
  --restore-time 2026-10-30T09:59:00Z

A backup you have never restored is a hope, not a backup. Schedule restore tests, time them, and compare the time to your RTO.

Disaster recovery strategies

When a whole Region is unavailable, the answer is a second Region. AWS describes four strategies on a spectrum from cheap and slow to expensive and fast. You pick the cheapest one that meets your RTO and RPO.

flowchart LR
    B["Backup<br/>and restore"] --> P["Pilot light"]
    P --> W["Warm standby"]
    W --> A["Active-active"]

Cost and readiness rise from left to right; recovery time falls.

Strategy What runs in the second Region Typical RPO Typical RTO
Backup and restore Nothing; only copies of backups Hours Hours to a day or more
Pilot light Data replicated; compute switched off, templates ready Seconds to minutes Tens of minutes to hours
Warm standby A scaled-down, running copy of everything Seconds Minutes
Active-active Full capacity serving real traffic Near zero Near zero
  • Backup and restore. Copy snapshots and backups to the other Region. After a disaster, rebuild with infrastructure as code (CloudFormation) and restore data. Cheapest and slowest.
  • Pilot light. The data layer, such as a cross-Region read replica or DynamoDB global table, is always live. Servers are not running, but images and templates are ready to scale up. Like the small flame that relights a gas heater.
  • Warm standby. A smaller but complete working copy is always running and can serve traffic. On failover you scale it up and switch Route 53 over.
  • Multi-site active-active. Both Regions serve users. Data stores must accept writes in both (DynamoDB global tables, Aurora Global Database with a single writer plus fast promotion, or a design that avoids conflicts). It is the most complex and expensive, and needs the most care with consistency.

Failover itself needs automation. Route 53 health checks and failover or latency routing steer users to the surviving Region, and tested runbooks do the rest. Disaster recovery that depends on a person finding a document during an outage tends to miss its RTO. Rehearse at least once a year, and make sure the recovery Region has enough quota for the capacity you would need in a hurry.

Cross-Region designs also have a trap: a control-plane dependency. If your failover needs a console action or an API in the very Region that failed, it will not happen. Prefer data-plane mechanisms (health-checked DNS records, pre-provisioned capacity) for the critical switch.

Making DR real: drills, automation and AWS Backup

A DR plan that was never run is a guess. Three habits turn it into something you can trust:

  • Schedule drills. Run a game day at least once or twice a year: fail over a copy of a real workload, time every step, and write down what surprised you. AWS Fault Injection Service can inject failures such as stopped instances or blocked network paths in a controlled way.
  • Automate all infrastructure. If the recovery Region is rebuilt from CloudFormation, CDK or Terraform, recovery is a deployment, not an archaeology project. Keep the templates, AMIs and secrets available in the recovery Region.
  • Leverage AWS Backup. One service defines backup plans (schedule, retention, copy to another Region or account) for EBS, RDS, DynamoDB, EFS and more, with a locked vault so that a compromised account cannot delete the copies. For servers outside a managed database, AWS Elastic Disaster Recovery keeps a continuously replicated low-cost copy ready to launch.

The drill below adds up the measured steps of a failover and compares the total with the RTO target. The durations are invented.

Python Did the drill meet its RTO?

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

A DR strategy chooser

The next stand-in picks the cheapest strategy that meets a target RTO and RPO, using the typical ranges above and invented relative costs. Then it simulates a nightly-backup design to show what RPO means in lost orders. Real planning uses measured restore times and real prices.

Python Pick a DR strategy and simulate data loss

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Look at which applications fall into each tier. Most systems do not need the expensive options, and spending evenly on all of them wastes money. Tier your applications by business impact, then match each tier to a strategy.

Putting it together

A practical checklist:

  1. Write down RTO and RPO per application, with the business owner.
  2. Spread every tier across at least two AZs; make each AZ able to carry the full load if the other disappears.
  3. Back up everything that matters, copy backups to another account and Region, and test restores.
  4. Pick a DR strategy per tier; automate failover and rehearse it.
  5. Use CloudWatch alarms and health checks so that failures are noticed in seconds, not by customers.
  6. Revisit the plan after every significant architecture change.

Check your understanding

Quick check ยท 5 questions

of 5 answered You scored / 5 ยท perfect!

  1. 1. What does RPO measure?

    RPO is the age of the last good copy of data at the moment of disaster. RTO is the one about downtime.
  2. 2. A database runs in Multi-AZ mode. Someone accidentally drops an important table. What happens?

    Multi-AZ replication protects against infrastructure failure, not mistakes. Backups and point-in-time recovery cover deletion and corruption.
  3. 3. Two independent copies of a component each have 99% availability, in parallel. About what is the combined availability?

    The pair fails only if both fail, and 0.01 x 0.01 = 0.0001, so availability is 99.99%. Real systems are lower because failures are not perfectly independent.
  4. 4. Which DR strategy keeps data replicated but runs no application servers in the second Region until a disaster?

    Pilot light keeps the data layer live and compute switched off, with images and templates ready to scale up.
  5. 5. Why should you restore from a backup before you actually need to?

    Untested backups often fail in surprising ways. A rehearsal proves they work and shows how long recovery really takes.

Summary

  • High availability handles common failures automatically by spreading tiers across Availability Zones; disaster recovery handles rare large failures by recovering elsewhere.
  • RTO is the time you can be down; RPO is the data you can lose. Both are business decisions.
  • Series components multiply availability down; parallel copies raise it, with diminishing returns.
  • Multi-AZ replication is not a backup. Keep tested backups, ideally in a separate account and Region.
  • The DR strategies are backup and restore, pilot light, warm standby and active-active; choose the cheapest one that meets the targets and automate and rehearse failover.

Next: Common Architecture Patterns