System Design
12. Reliability and Fault ToleranceAnimated
Circuit Breakers
Fail fast when a dependency is unhealthy.
The idea
Open the circuit after repeated failures so callers stop waiting and the dependency can recover.
Watch it work
Press play, pause, or step through. Some animations have settings you can change.
- closed
- open
- half-open
Service healthy: calls pass through. Failures are counted.
- tick:
- 1
1/24
The downstream service is down from tick 7 to 14.
Step by step
- 1Monitor calls
- 2Open at a failure threshold
- 3Fail fast
- 4Probe and close
Where it is used
Resilient service calls.
Watch out for
Poor thresholds cause flapping.