Reliability Engineering & Observability
SLIs, SLOs, SLAs and error budgets, availability math for serial and parallel components, redundancy and failover, health checks, disaster recovery with RPO/RTO, backups, observability (metrics, logs, traces, RED/USE methods), alerting on symptoms and burn rates, chaos engineering, incident response and blameless postmortems.
Measuring reliability
| Availability | Downtime / year | / 30 days | / week |
|---|---|---|---|
| 99% | 3.65 days | 7.2 h | 1.68 h |
| 99.9% | 8.77 h | 43.2 min | 10.1 min |
| 99.95% | 4.38 h | 21.6 min | 5 min |
| 99.99% | 52.6 min | 4.3 min | 1 min |
| 99.999% | 5.26 min | 26 s | 6 s |
Good SLIs by system type: request/response (availability, latency percentiles), pipelines (freshness, correctness, throughput), storage (durability, read/write availability).
Availability math
def series(*a): # all must be up
p = 1.0
for x in a: p *= x
return p
def parallel(a, n): # any of n independent replicas
return 1 - (1 - a) ** n
print(round(series(0.9999, 0.999, 0.9995) * 100, 3)) # 99.84
print(parallel(0.99, 2)) # 0.9999
Redundancy and failover
| Layer | Technique |
|---|---|
| Compute | N+1/N+2 instances across ≥ 3 AZs, autoscaling, health-checked LB |
| Data | replicas across AZs, automatic failover (Patroni, RDS Multi-AZ, Raft-based DBs) |
| Network | multiple LBs, anycast, redundant DNS providers |
| Region | DR region or active-active |
| Dependencies | fallbacks, caches of last good response, multiple vendors (payment, SMS) |
Health checks: shallow (process alive) vs deep (dependencies OK). Deep checks can cause mass eviction when a shared dependency fails — LBs should "fail open" when all targets look unhealthy.
Static stability: design so the system keeps working in its current state when the control plane (autoscaler, config service) fails — e.g., pre-provision capacity in each AZ to absorb an AZ loss rather than relying on scaling up during the incident.
Disaster recovery
Backups: 3-2-1 rule (3 copies, 2 media, 1 offsite), point-in-time recovery (base backup + WAL archive), immutable/air-gapped copies against ransomware, and scheduled restore drills. Replication is not a backup — it faithfully replicates DROP TABLE.
Observability
| Method | For | Signals |
|---|---|---|
| RED | request-driven services | Rate, Errors, Duration |
| USE | resources (CPU, disk, pools) | Utilisation, Saturation, Errors |
| Four golden signals (Google SRE) | any user-facing system | latency, traffic, errors, saturation |
Track percentiles (p50, p95, p99, p99.9), never just averages — averages hide the tail, and at fan-out the tail dominates (a page calling 100 services sees the p99 of each on most loads).
Alerting on burn rate
| Severity | Condition (99.9% SLO) | Action |
|---|---|---|
| Page | 2% of monthly budget burned in 1 h (14.4× rate) | wake someone |
| Page | 5% burned in 6 h (6× rate) | wake someone |
| Ticket | 10% burned in 3 days (1× rate) | next business day |
Incident response
- Detect (alerts, user reports) → 2. Triage and declare severity → 3. assign an incident commander, communications lead, and responders → 4. Mitigate first (roll back, fail over, shed load, toggle feature flag) — root cause later → 5. communicate status (status page) → 6. resolve → 7. blameless postmortem: timeline, impact, contributing factors, what went well, action items with owners.
Chaos engineering
Hypothesis → inject fault → observe SLIs → fix → automate. Examples: terminate random instances, inject 500 ms latency into a dependency, black-hole an AZ, fill a disk, expire certificates early, return errors from DNS.
Interview questions
Answer out loud first, then open the model answer. Mark a question confident only when you could explain it to an interviewer without notes.