Resilience Engineering and Disaster Recovery

Designing cloud native systems to survive failure: failure domains, redundancy across zones and regions, timeouts, retries, circuit breakers, bulkheads and load shedding, graceful degradation, Kubernetes resilience features, RPO and RTO, DR strategies from backup-restore to active-active, backup with Velero, and chaos engineering.

On this page

Simple definition#

Resilience is a system’s ability to keep serving users — perhaps in a degraded way — when parts fail, and to recover quickly. Disaster recovery (DR) is the plan and capability to restore service and data after a large failure such as losing a region.

Think in failure domains#

Failure domains, small to large
flowchart LR
    P["Process / container"] --> PD["Pod"] --> N["Node"] --> Z["Availability zone"] --> R["Region"] --> CP["Cloud provider"]
    D["Dependencies: DB, queue,<br/>third-party API, DNS, IdP"] -.-> PD

For each domain ask: what fails, how do we detect it, what is the blast radius, how do we recover, and how long does it take?

Resilience patterns#

Pattern What it does Where
Redundancy Multiple replicas across nodes and zones Deployments, topology spread, multi-AZ databases
Timeouts Never wait forever Every network call; shorter than the caller’s timeout
Retries with backoff + jitter Survive transient errors Idempotent operations only; with a retry budget
Circuit breaker Stop calling a failing dependency; fail fast Client libraries (Resilience4j) or mesh
Bulkhead Isolate resources so one failure cannot exhaust all Separate pools, queues, node pools
Load shedding / rate limiting Reject excess work early to protect the core Gateways, services
Graceful degradation Serve a reduced experience Cached data, default recommendations, read-only mode
Idempotency Safe to repeat requests Idempotency keys on writes
Queue-based load levelling Absorb bursts asynchronously Kafka, SQS, RabbitMQ
Resilient call to a dependency
flowchart LR
    C["Caller"] --> T["Timeout"]
    T --> R["Retry: backoff + jitter,<br/>budget"]
    R --> CB{"Circuit<br/>breaker"}
    CB -->|"closed"| D["Dependency"]
    CB -->|"open"| F["Fallback<br/>cache / default / degrade"]
    D -->|"errors exceed threshold"| CB

Kubernetes resilience features#

  • Multiple replicas + topology spread constraints across zones.
  • PodDisruptionBudgets protect availability during drains and upgrades.
  • Readiness probes keep unready Pods out of rotation; graceful shutdown with preStop and termination grace periods.
  • Priority classes keep critical workloads scheduled under pressure.
  • Autoscaling headroom; node pools spread across zones.

RPO and RTO#

Term Question Driven by
RPO — Recovery Point Objective How much data can we lose? Backup frequency, replication mode
RTO — Recovery Time Objective How long can we be down? DR strategy, automation, rehearsal

DR strategies#

DR strategies: cost vs recovery speed
flowchart LR
    BR["Backup & restore<br/>RTO hours–days<br/>lowest cost"] --> PL["Pilot light<br/>core data replicated,<br/>compute off"]
    PL --> WS["Warm standby<br/>scaled-down copy running<br/>RTO minutes"]
    WS --> AA["Active-active<br/>multi-region serving<br/>RTO ~0, highest cost"]
Strategy RPO RTO Cost Notes
Backup & restore Hours Hours–days Low Restore clusters from Git + backups
Pilot light Minutes Hours Medium-low Data replicated; infra created on failover
Warm standby Seconds–minutes Minutes Medium Smaller running copy, scale up on failover
Active-active ~0–seconds ~0 High Data consistency across regions is the hard part

Kubernetes helps: clusters and apps are rebuildable from Git (GitOps), making backup-restore and pilot light much faster than for hand-built estates.

Backups#

  • Velero: backs up Kubernetes objects and persistent volumes (snapshots or file-level), schedules, restores to another cluster.
  • Database-native backups and point-in-time recovery (managed services or operators such as CloudNativePG).
  • Registry replication across regions; secrets store replication.
  • Test restores regularly — an untested backup is a hope, not a plan.

Chaos engineering#

Deliberately inject failures in a controlled way to find weaknesses before they cause incidents.

Chaos experiment loop
flowchart LR
    H["Hypothesis<br/>'losing one zone keeps<br/>checkout SLO'"] --> E["Experiment<br/>small blast radius,<br/>abort conditions"]
    E --> O["Observe SLIs"]
    O --> L["Learn + fix"]
    L --> H
  • Tools: LitmusChaos, Chaos Mesh (CNCF), AWS Fault Injection Service, Azure Chaos Studio, Gremlin.
  • Start in non-production with game days; progress to production with tight safeguards.
  • Typical experiments: kill Pods, drain a node, block a zone, add latency to a dependency, fail DNS, expire certificates.

Common mistakes#

Quick check#

What is the difference between RPO and RTO? RPO is the maximum acceptable data loss (time); RTO is the maximum acceptable downtime.

Name four resilience patterns. Timeouts, retries with backoff and jitter, circuit breakers, bulkheads (also load shedding, graceful degradation, idempotency).

What is a PodDisruptionBudget for? It limits how many Pods of an application can be voluntarily disrupted at once, protecting availability during drains and upgrades.

Compare warm standby and active-active. Warm standby runs a scaled-down copy that takes over in minutes; active-active serves from multiple regions continuously with near-zero RTO but higher cost and data-consistency complexity.

What is chaos engineering? Running controlled experiments that inject failures to test hypotheses about resilience and fix weaknesses before real incidents.

Summary#

  • Design per failure domain; use redundancy, timeouts, retries, circuit breakers, bulkheads and degradation.
  • Use Kubernetes features: spread, PDBs, probes, priorities.
  • Set RPO/RTO per service; choose backup-restore, pilot light, warm standby or active-active.
  • Back up and rehearse; practise chaos engineering safely.

References#