Cascading Failures
You'll learn how a single component failure can trigger a domino effect, bringing down your entire system.
The Domino Effect in Systems
A cascading failure occurs when one component's failure creates additional load or failures in dependent components, which then fail and affect their dependents, creating a chain reaction throughout your system.
Think of it like a traffic jam: one stalled car on a highway causes others to slow down. As more cars pile up, some drivers take alternate routes, overloading those roads. Soon, nearby streets are gridlocked, parking lots fill up, and the entire city's traffic system grinds to a halt—all from one initial failure.
How Cascades Happen
When Service A fails, services depending on A might:
- Retry aggressively, overwhelming A when it tries to recover
- Queue up requests, consuming their own memory until they crash
- Time out slowly, tying up threads and preventing them from handling other work
- Fail themselves, causing their dependents to experience the same problems
Without circuit breakers, timeouts, bulkheads, or rate limiting (patterns you've already learned), one failure spreads exponentially. The system becomes increasingly unstable as each component's failure amplifies the load on remaining healthy components.
Real-World Example
Database becomes slow → API servers wait on database connections → API thread pools fill up → Load balancer sees slow responses and marks servers unhealthy → Remaining servers receive more traffic → They become overloaded and fail → Entire system down.
Each failure made the next one more likely and more severe. This is why resilience patterns are often used in combination—they protect not just individual services, but prevent system-wide collapse.
Key Takeaway: Cascading failures occur when one component's failure triggers a chain reaction through dependent systems; preventing them requires resilience patterns at every level to isolate failures and prevent propagation.