# Circuit Breaker Pattern

> Stop calling a failing service for a while. Then trouble does not spread.

**Field:** Software Development  
**Category:** Architecture  
**Also known as:** Circuit Breaker

## Think of it like

Think of it like the fuse box in a house. When something goes wrong, it cuts the power fast.

## Definition

A circuit breaker stops calling a service that keeps failing. That keeps the failure from spreading. It counts errors on calls to that service. After too many, it opens and fails new calls at once, without waiting. After a short rest it lets one test call through. If that works, it closes and normal calls start again.

## Example

Lucy's shop calls a slow reviews service. After 5 failures in a row, the breaker opens. Product pages load without reviews instead of hanging for 30 seconds.

## Why it matters

Without it, one slow service can tie up every caller. Then the whole system goes down with it.

## Common mistake

Showing users an error page when the breaker opens. A good fallback, like hiding the reviews box, keeps the page useful.

## Three principles

- **Count the failures.** Then open.
- **Fail fast.** Do not wait on a dead service.
- **Test, then close.** One call to check.

## Related terms

- [Retry with Exponential Backoff](https://learn.benibix.com/term/development/retry-with-backoff)
- [Single Point of Failure](https://learn.benibix.com/term/development/single-point-of-failure)
- [Microservices](https://learn.benibix.com/term/development/microservices)
- [Distributed System](https://learn.benibix.com/term/development/distributed-system)
- [Graceful Degradation](https://learn.benibix.com/term/infrastructure/graceful-degradation)
- [Timeout](https://learn.benibix.com/term/development/timeout)

## Told apart from

- [Circuit Breaker vs Retry with Backoff](https://learn.benibix.com/compare/circuit-breaker-vs-retry-with-backoff): People think a circuit breaker is just a limit on retries, and it is not. A retry tries one failed call again, waiting longer each time. A circuit breaker watches all calls to a service. Once too many fail, it stops sending any for a while. Retries help with a short blip. The breaker helps when a service is truly down.

---

Source: https://learn.benibix.com/term/development/circuit-breaker
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
