Circuit Breaker
A circuit breaker stops calling a failing dependency, converting slow repeated failures into a fast, cheap one.
A circuit breaker is a client-side safeguard that stops sending requests to a dependency once it's clearly failing, rather than letting every caller retry against it and pile up. The name and mental model come from electrical circuit breakers: trip once, and stop the current until someone (or something) decides it's safe again.
It runs as a small state machine. Closed is the normal state — requests pass through, and failures are counted. Enough failures in a window trips it open, where calls fail immediately without ever touching the network, which is the whole point: an open breaker turns a slow timeout into an instant, cheap failure, and stops one struggling dependency from starving the caller's own thread pool or connection limit while it waits on doomed requests. After a cooldown the breaker goes half-open and lets a small number of test requests through; if those succeed, it closes again, and if they fail, it reopens the cooldown.
This is a different failure mode than a plain timeout. A timeout still pays the full wait on every call before giving up; a circuit breaker remembers that the dependency was failing and skips the wait entirely, which matters most under load — a slow database doesn't just get one request stuck, it gets every concurrent request stuck, and that's what actually takes a system down. It also complements Rate Limiting and Backpressure: rate limiting protects a service from too many callers, backpressure tells a caller to slow down, and a circuit breaker is the caller giving up on a dependency it decides isn't going to answer usefully anyway.
Circuit breakers are usually scoped per dependency, not globally — a failing payment provider shouldn't trip a breaker that also gates calls to an unrelated, healthy service.
See also6
Load Balancing
A load balancer spreads requests across many backend instances, turning "one server" into "one address."
Networks & Distribution15 connections
Race Condition
A defect whose occurrence depends on the relative timing of concurrent operations.
Testing & Verification36 connections
Service Virtualization
Replacing a real external service with a simulated one that speaks the same protocol over the network, so tests can run without the real dependency and can reproduce its failures on demand.
Testing & Verification15 connections
Hysteresis
The dependence of a system's state on its history as well as its present input, seen in magnets, rubber, and freezing water, and built deliberately into thermostats and switches so they don't flicker at a threshold.
Matter & Energy7 connections
Fail-Safe
A design principle in which a system that breaks falls into a safe state rather than a dangerous one, as when a railway signal drops to stop or a train's brakes apply if their air line is cut.
Testing & Verification6 connections
Failure Detection
How the nodes of a distributed system decide that a peer has died, using heartbeats and timeouts, when a crashed node and a slow one look exactly the same from outside.
Networks & Distribution11 connections
Linked from12
- API GatewayNetworks & Distribution
An API gateway is the single front door to a set of backend services, handling cross-cutting policy once instead of per-service.
- BackpressureNetworks & Distribution
Backpressure is a slow receiver telling a fast sender to hold up, so a queue grows on purpose instead of by accident.
- Chaos EngineeringTesting & Verification
Deliberately breaking parts of a running system to prove it survives failures that will eventually happen anyway.
- Exponential BackoffNetworks & Distribution
Waiting longer after each failed attempt, with a dose of randomness, so retries give a struggling system room to recover instead of hammering it.
- Fail-SafeTesting & Verification
A design principle in which a system that breaks falls into a safe state rather than a dangerous one, as when a railway signal drops to stop or a train's brakes apply if their air line is cut.
- Failure DetectionNetworks & Distribution
How the nodes of a distributed system decide that a peer has died, using heartbeats and timeouts, when a crashed node and a slow one look exactly the same from outside.
- HTTP Status CodeWeb Platform
The three-digit number at the start of every HTTP response that tells the client, caches, crawlers and monitoring what happened, grouped into five classes by the first digit.
- HysteresisMatter & Energy
The dependence of a system's state on its history as well as its present input, seen in magnets, rubber, and freezing water, and built deliberately into thermostats and switches so they don't flicker at a threshold.
- Load BalancingNetworks & Distribution
A load balancer spreads requests across many backend instances, turning "one server" into "one address."
- Rate LimitingNetworks & Distribution
Rate limiting caps how often a client can act, protecting shared capacity by rejecting or delaying the excess.
- Service VirtualizationTesting & Verification
Replacing a real external service with a simulated one that speaks the same protocol over the network, so tests can run without the real dependency and can reproduce its failures on demand.
- TimeoutNetworks & Distribution
The limit on how long to wait for a remote call, the most basic defense against a hung dependency, and the harder problems of choosing the number and passing the remaining time down a chain of services.