System Design
11. Microservices ArchitectureAnimated
Circuit Breaker Pattern
Stop calling a failing service for a while.
The idea
After repeated failures, the breaker opens and fails fast, then tests recovery.
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
- 1Count failures
- 2Open at a threshold
- 3Fail fast while open
- 4Try a trial call and close if healthy
Where it is used
Calls to remote services.
Watch out for
Tune thresholds, or it opens too early or too late.