LESSON 8

Reliability, Availability, and Resilience

Design for failure: availability targets, failure mode analysis, resilience patterns, backup and recovery, and graceful degradation.

Introduction

Everything fails eventually: disks, networks, dependencies, deployments, people. Reliability engineering accepts this and designs so that failures are expected, contained, detected, and recoverable.

The aim is not zero failure, which is impossible and unaffordable, but meeting the availability and recovery targets the business actually needs at a cost it can afford.

Learning Objectives

  • Interpret availability targets and their cost implications.
  • Perform a failure mode analysis of a design.
  • Apply resilience patterns: redundancy, timeouts, retries, circuit breakers, and graceful degradation.
  • Define backup, recovery point, and recovery time objectives.
  • Design for safe deployment and rollback.
  • Use AI to find failure modes while validating by testing.

1. What Availability Targets Mean

Availability Allowed downtime per 30-day month
99% about 7 hours 18 minutes
99.5% about 3 hours 39 minutes
99.9% about 43 minutes
99.99% about 4 minutes 19 seconds

Each additional nine typically costs far more: redundancy across zones, automated failover, round-the-clock on-call, and mature operations. The SRS target for SignalDesk (illustratively 99.5%) is achievable with a straightforward redundant design. Confirm with stakeholders that the business does not need more, and that it understands what it costs.

Remember: the availability of a system is limited by the availability of everything in its critical path. Three components at 99.9% each in series give roughly 99.7% overall.

2. Define Recovery Objectives

Term Meaning Question
RPO (recovery point objective) Maximum acceptable data loss, measured in time How much work can we afford to lose?
RTO (recovery time objective) Maximum acceptable time to restore service How long can we be down?

Illustrative for SignalDesk: RPO of 15 minutes and RTO of 4 hours. These objectives drive backup frequency, replication, and the recovery procedure. They also differ by data: uploaded files and the database may deserve different treatment than a rebuildable search index.

3. Failure Mode Analysis

For each component and dependency, ask: How can it fail? What is the effect? How do we detect it? How do we recover?

Component Failure Effect Detection Mitigation
Application instance Crash Fewer instances serve traffic Health check Multiple instances; automatic replacement
Database primary Hardware failure Writes unavailable Health monitoring Standby with failover; tested restore
Queue Unavailable New imports cannot be queued Metrics, alerts Retry with backoff; show clear message; durable queue
Worker Crash mid-import Import incomplete Job status timeout Job retried; idempotent writes
Email provider Outage Notifications delayed Delivery errors Queue and retry; degrade gracefully
Search index Corruption Search degraded Error rate Rebuild from database; fall back to basic database search
Deployment Faulty release Errors after release Error-rate alert Automated rollback; gradual rollout
Human Wrong command or migration Data loss Audit, alerts Access controls; backups; reviews

Look for single points of failure and for failures that cascade. Rank by likelihood and impact, and address the highest first.

4. Resilience Patterns

Pattern Purpose
Redundancy Several instances; no single point of failure
Health checks Remove unhealthy instances from service
Timeouts Never wait forever on a dependency
Retries with exponential backoff and jitter Recover from transient errors without stampedes
Circuit breaker Stop calling a failing dependency; fail fast; recover gradually
Bulkhead Isolate resources so one failing part cannot exhaust all
Idempotency Make retries safe
Dead-letter queue Hold messages that repeatedly fail for inspection
Rate limiting and load shedding Protect the system under overload
Graceful degradation Keep core functions working when a non-critical one fails

Retries without limits can turn a small outage into a large one. Always bound retries and add backoff.

5. Graceful Degradation

Decide in advance what is essential and what can degrade.

Failure Degraded behavior
Search index unavailable Fall back to basic filtering; show a notice
Email provider unavailable Queue notifications; display in-app instead
Summary generation fails Show the evidence list without the generated summary
Import worker backlog Show queue position and estimated delay

This keeps users productive, and the business decides which behaviors are acceptable; record them as requirements if they were not already.

6. Backup and Recovery

  • Take regular, automated backups of data that cannot be rebuilt (database, uploaded files).
  • Store backups separately from the primary system and encrypt them; keep them within permitted regions.
  • Test restores. An untested backup is only a hope. Schedule restore drills and record how long they take against the RTO.
  • Support point-in-time recovery where the RPO requires it.
  • Document the recovery runbook so it can be followed under stress.
  • Consider the deletion requirement: purge schedules must also cover backups.

7. Deployment Safety

A large share of outages follow changes.

  • Deploy gradually (rolling or canary) and monitor error rates.
  • Make rollback fast and rehearsed.
  • Keep database migrations backward compatible so the previous version still works.
  • Use feature flags to separate deployment from release.
  • Automate; manual steps invite mistakes.

These practices are expanded in the DevOps and release course.

8. Observability as a Reliability Tool

You cannot recover from a failure you cannot see. Plan from the start:

  • Metrics: request rate, error rate, latency percentiles, queue depth, job failures, resource use.
  • Logs: structured, with correlation identifiers, and free of sensitive data.
  • Traces: follow a request across components.
  • Alerts: tied to user impact (symptoms), with runbooks, not noisy resource thresholds.

Service level objectives (SLOs) express targets such as “99.5% of requests succeed within one month”, and error budgets help decide when to prioritize reliability over features. Operations is covered in depth in the final course of the series.

9. Use AI to Explore Failure Modes

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Act as a site reliability engineer reviewing an architecture.

Architecture description, availability and recovery targets, and
dependencies:
[Paste.]

Tasks:
1. Build a failure mode table: component, failure, effect on users,
   detection, mitigation. Cover every component and dependency.
2. Identify single points of failure and cascading failure paths.
3. Identify where retries could cause overload.
4. Check whether the stated RPO and RTO are achievable with the
   described backup and recovery approach, and list what is missing.
5. Propose graceful degradation behaviors for non-critical failures.

Do not assume features of specific products. Mark every assumption.

Verify by exercising failures: stop an instance, block a dependency, restore a backup. A design that has not been tested against failure has only theoretical resilience.

10. Practical Exercise

  1. Convert your availability requirement into downtime allowance and confirm its cost implications.
  2. Define RPO and RTO per data type.
  3. Produce a failure mode table covering every container and external dependency, at least 12 rows.
  4. Specify timeouts, retry policy, and circuit-breaker use for each external call.
  5. Define graceful degradation behavior for at least four failures.
  6. Write the backup and restore plan, including a restore test schedule.
  7. Run the AI review and triage its findings.

Verification

You are ready to continue when:

  • Availability, RPO, and RTO are defined and justified.
  • Every component and dependency has a failure analysis.
  • Single points of failure are removed or explicitly accepted with reasons.
  • Retries are bounded, and operations are idempotent where retried.
  • Backups are tested in a restore plan.

Key Takeaways

  • Each additional nine of availability costs disproportionately more; design to the real need.
  • Analyze failure modes systematically and eliminate single points of failure.
  • Combine timeouts, bounded retries, circuit breakers, and graceful degradation.
  • Untested backups and untested failure handling cannot be trusted.

What’s Next?

By now we have made many design choices, each with benefits and costs. Next, we learn to analyze trade-offs explicitly and evaluate the architecture against our scenarios.