11. Availability, Resilience, and Disaster Recovery

Availability arithmetic

  • Availability = successful available time / total measured time, according to the agreed measurement definition.
  • Approximate annual downtime = (1 − availability fraction) × 365 days.
  • 99.9% availability corresponds to about 8 hours 46 minutes of downtime per 365-day year.
  • 99.99% corresponds to about 52 minutes 34 seconds per year.
  • 99.999% corresponds to about 5 minutes 15 seconds per year.

Reliability patterns

  • Health checks and automatic replacement.
  • Replication across independent failure domains.
  • Timeouts on network calls.
  • Bounded retries with exponential backoff and jitter.
  • Circuit breakers to stop repeatedly calling failing dependencies.
  • Bulkheads to isolate resource pools or workloads.
  • Rate limiting and load shedding under overload.
  • Graceful degradation for noncritical features.

Timeout rule: a timeout should fit within the caller's latency budget and leave time for cleanup or fallback. Retries should be limited; uncontrolled retries amplify outages.

Recovery objectives

  • RPO (Recovery Point Objective): acceptable data loss measured in time.
  • RTO (Recovery Time Objective): acceptable time to restore service.

Disaster recovery strategies

  • Backup and restore: lower cost, typically slower recovery.
  • Pilot light: minimal critical infrastructure is always running.
  • Warm standby: a reduced-capacity environment is ready to scale.
  • Active-active: multiple environments serve traffic, requiring more complex data and conflict management.

Failure analysis: identify the blast radius of an instance failure, zone outage, regional outage, credential compromise, and dependency failure. Redundancy only improves availability when components do not share the same critical failure mode.

Key Takeaways
  • Define availability objectives and how they are measured.
  • Use timeouts, bounded retries, circuit breakers, and load shedding deliberately.
  • RPO describes tolerable data loss; RTO describes restoration time.
  • Test backups and disaster recovery procedures rather than assuming they work.