Availability, SLOs and Disaster Recovery

Quantify reliability with SLIs, SLOs and error budgets, design redundancy across zones and regions, and plan backups with clear RPO and RTO targets.

Intermediate · about 3 hours · difficulty 3/5

Learn first: Replication, Observability: Logs, Metrics and Traces

"Highly available" means nothing until you put a number on it.

Measuring availability

  • SLI (indicator): what you measure, such as the percentage of successful requests under 300 ms.
  • SLO (objective): the target, such as 99.9 percent over 30 days.
  • SLA (agreement): a contractual promise with penalties, usually looser than the SLO.
  • Error budget: 100 percent minus the SLO. At 99.9 percent you can be down about 43 minutes a month; at 99.99 percent about 4.3 minutes. Spend the budget on releases and experiments; when it runs out, slow down and fix reliability.

Availability maths

Components in series multiply availabilities (two 99.9 percent services in a chain give about 99.8 percent). Components in parallel (redundant replicas) improve it. Remove single points of failure by having at least two of everything critical.

Redundancy levels

  • Multiple instances behind a load balancer.
  • Multiple availability zones (separate data centres in one region, for example Mumbai ap-south-1 zones). The standard baseline for production.
  • Multiple regions: active-passive (standby region takes over) or active-active (both serve traffic; much harder because of data consistency). Needed for the strictest targets or regulatory resilience.

Backups and disaster recovery

  • RPO (recovery point objective): how much data you can afford to lose (for example 5 minutes).
  • RTO (recovery time objective): how long recovery may take (for example 1 hour).

These drive the strategy: periodic backups, point-in-time recovery from WAL archives, warm standby, or full active-active. Test restores regularly; an untested backup is a hope, not a plan. Keep backups in another account or region.

Pitfalls

  • Promising 99.99 percent while depending on a single database primary with manual failover.
  • Never running a failover or restore drill until a real incident.

You are ready to move on when you can compute the monthly downtime allowed by 99.95 percent, and propose an RPO, RTO and DR setup for a payments service versus a blog.

Key concepts

  • SLI, SLO and SLA
  • Error budgets
  • Series vs parallel availability
  • Multi-AZ deployment
  • Multi-region active-passive and active-active
  • RPO and RTO
  • Backup and restore drills

Mini project

Write an SLO document for a ticket booking API: two SLIs, SLO targets, error budget policy, and a DR plan with RPO and RTO. Then practise a point-in-time restore of a Postgres database and record how long it took.

Check yourself

Your checkout calls four services in series, each at 99.9 percent availability. What is the rough availability of checkout, and what could you do to raise it?

Free resources