What is a Circuit Breaker?
The circuit breaker, told as a story about the red emergency button in front of a broken ride.
Keep sending guests to a broken ride, and both hurt guests and a tied-up mechanic pile up.Time and people keep getting tied down by that one ride.
Keep retrying what won't work, and you only waste time and resources.Knocking on a broken door forever doesn't help.
Keep failing, and pressing the button sends no one there.After a bit, one guest quietly tests it, and if it's fine, it reopens.
Succeed and it returns to closed; fail and it goes back to open.It cycles through three states as it keeps checking on the ride.
Too sensitive a button keeps blocking things that are fine.Setting the right threshold is what keeps false alarms down.
Circuit breaker = when a ride keeps failing, pressing the red button so no one is sent there at all. After a bit, one guest tests it, and if it's fine, it reopens.
A pattern that cycles through three states: closed (normal), open (blocked entirely), and half-open (test with one). Unlike a retry, it means sending nothing at all for a while — and a poorly tuned threshold creates false positives that block services that are actually fine.
When grown-ups say it
- Circuit breaker
- The red emergency button in front of a broken ride. Press it, and no one gets sent there.
- Closed state
- The normal state — guests go through as usual. This is the default when nothing's wrong.
- Open state
- The blocked state — no one is sent. Repeated failures flip it into this state.
- Half-open state
- The testing state — one guest is quietly sent in. Fine, and it closes again; not fine, and it reopens.
- Threshold
- The rule for how many failures trigger the button. Too low causes false alarms; too high reacts too late.
- Retry
- Waiting a bit and lining up again after a failure. A circuit breaker sends nothing at all; a retry tries again — two different responses. → waiting a bit, then lining up again
- Cascading failure
- One place's trouble spreading to the next, and the next. A circuit breaker cuts it off before it grows.
- Bulkhead
- Splitting the park into zones to contain the damage. Often used together with a circuit breaker for extra safety. → zones that keep trouble from spreading