Circuit Breakers, Bulkheads & Graceful Degradation
Resilience Patterns | Technical Operations Excellence
Prevents cascading failures by stopping requests to failing services.
Normal operation, requests pass through
Requests blocked, return fallback immediately
Limited test requests to check recovery
Like watertight compartments in ships - isolate failures to prevent sinking.
| Type | Mechanism | Use Case |
|---|---|---|
| Thread Pool | Dedicated pool | Isolate slow deps |
| Semaphore | Concurrency limit | Lightweight isolation |
Reduce work or quality to maintain availability during failures.
| Strategy | Example |
|---|---|
| Quality Reduction | Lower image resolution |
| Feature Shedding | Disable recommendations |
| Subset Query | Search cache only |
| Default Response | Return static content |
delay = min(maxBackoff, base * 2^attempt + jitter)
| Aspect | L4 (Transport) | L7 (Application) |
|---|---|---|
| Routing | IP + Port | HTTP headers, URLs |
| Latency | 10-100 µs | 0.5-3 ms |
| CPU | Low | High (TLS) |
| Best For | DDoS, non-HTTP | Smart routing |
Production: Layer both (L4 edge → L7 internal)
| Type | Typical Value |
|---|---|
| Connect | 250ms - 1s |
| Header | 5 - 30s |
| Idle | 30 - 300s |
Critical: Timeouts DECREASE deeper in call chain
Multiple independent layers - no single layer is exclusively relied upon.
| Pattern | Purpose |
|---|---|
| Timeouts | Bound waiting time |
| Bulkheads | Isolate resources |
| Load Shedding | Reject before instability |
| Deadlines | Propagate time limits |
Fail Fast, Recover Faster
Every pattern protects downstream dependencies.