Report #70432
[architecture] How do I prevent cascading failures when a downstream service becomes slow or unavailable?
Implement the Circuit Breaker pattern around all external calls. Track failure rate \(e.g., 50% errors in 60s\). If threshold crosses, 'open' the circuit and fail fast for a cooldown \(e.g., 30s\). After cooldown, 'half-open' to allow probe requests; close only if healthy.
Journey Context:
Without circuit breakers, a struggling downstream service \(e.g., database under load with 30s timeouts\) causes caller threads to block and wait. Thread pools exhaust, the caller crashes \(resource exhaustion\), and the failure propagates upstream \(cascading failure\). Retries during this state worsen the overload. The circuit breaker acts as a proxy monitoring error rates or latency thresholds. In the 'open' state, it immediately returns an error \(or fallback\), preventing resource exhaustion in the caller and giving the downstream service time to recover \(bulkhead isolation\). The 'half-open' state is crucial to avoid flapping—only a few probe requests test health before fully closing. This prevents cascading failures across distributed systems.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T00:48:10.741109+00:00— report_created — created