Circuit breaker explained in plain terms means understanding a safety switch for software, one that stops a failing service from dragging every system that depends on it down with it. The central question is what happens when a service you rely on stops answering, and the answer is that a circuit breaker notices the failure, blocks further calls for a while, and lets the rest of the system carry on.
A circuit breaker is a resilience pattern used in distributed software, where one application calls another over a network. When the called service is slow or failing, repeated calls pile up, threads wait, queues fill, and the calling service can fail too, even though its own code is healthy. The breaker sits between the caller and the service, watching each call and deciding whether to let it through.
The pattern takes its name from the electrical switch in a home, which cuts the power when a fault is detected rather than letting the wiring overheat. In software the idea is the same: fail fast, give the struggling service time to recover, and protect the wider system from a cascade. This article explains what a circuit breaker is, how it works, and where it is used.
Key takeaways
- A circuit breaker stops calls to a failing service before they spread the failure.
- It has three states: closed, open, and half-open.
- A closed breaker lets calls through and watches for failures.
- An open breaker fails fast instead of waiting for a timeout.
- A half-open breaker tests recovery with a small number of trial calls.
What a circuit breaker is
A circuit breaker is a small component that wraps a call to another service, such as a payment provider, a database, or an internal microservice. Every call passes through it, and it records whether the call succeeded, failed, or took too long. When failures reach a set threshold, the breaker trips, changing its state so that new calls are rejected at once instead of being sent to a service that cannot cope.
The pattern was popularised by Michael Nygard in his book Release It!, published in 2007, which described how failures in production systems spread from one component to another. Nygard argued that systems should be designed to fail in a controlled way, and the circuit breaker became one of the best-known examples of that thinking, now used in libraries and frameworks across many programming languages.
A circuit breaker is not a way of fixing the failing service itself. It cannot repair a crashed database or a broken network link, and it does not replace retries, timeouts, or good monitoring. What it does is limit the damage while the fault lasts, keeping the calling system responsive and giving the failing service a chance to recover. Our guide to high availability explains the wider goal of keeping systems running through faults, and our guide to disaster recovery explains how organisations plan for larger outages.
How a circuit breaker works
In its normal state, called closed, the breaker lets every call through and keeps count of the results. A single failure means little on its own, since networks glitch and services restart, so the breaker looks for a pattern, such as a number of failures in a row, or a failure rate above a percentage over a short window of time.
When that threshold is crossed, the breaker opens. In the open state it stops sending calls to the failing service altogether, and instead returns an error immediately, a behaviour known as failing fast. The caller can then use a fallback, such as cached data, a default answer, or a polite message to the user, rather than waiting for a timeout that may never come.
Failing fast matters because waiting is expensive. A call that hangs ties up a thread, a connection, and memory, and if many calls hang at once, the calling service runs out of resources and fails as well. By refusing calls quickly, an open breaker keeps those resources free for work that can still succeed, which is how it stops one failure becoming many.
After a set period, known as the reset timeout, the breaker moves to the half-open state. In this state it allows a small number of trial calls through to test whether the service has recovered. If those calls succeed, the breaker closes again and normal traffic resumes. If they fail, it opens again and waits for another reset period before trying again.
The thresholds, timeouts, and trial counts are all settings that teams tune to their own services. A breaker that trips too easily will block healthy traffic after a brief blip, while one that trips too slowly will let a cascade start before it acts. Good settings come from watching real failure patterns and adjusting the numbers over time.

Comparing a circuit breaker with other resilience patterns
A circuit breaker is one of several patterns that help systems cope with failure, and each solves a different part of the problem. Retries try again after a failure, timeouts limit how long a call may wait, and bulkheads isolate resources, but none of them on their own stops a flood of calls reaching a service that is already down.
The table below sets out the main contrasts between the leading approaches.
| Aspect | Circuit breaker | Retry | Timeout |
|---|---|---|---|
| Purpose | Stop calls to a failing service | Try a failed call again | Limit how long a call waits |
| When it acts | After repeated failures | After a single failure | During a slow call |
| Effect on load | Reduces load on the service | Adds load to the service | Frees the caller sooner |
| Needs a fallback | Yes, for rejected calls | No, it repeats the call | No, it reports an error |
| Best for | Repeated or lasting failures | Brief, transient faults | Calls that may hang |
The practical result is that these patterns work best together: a timeout bounds each call, a retry handles a brief glitch, and a circuit breaker steps in when the fault is lasting, so the system degrades gracefully instead of collapsing.
Where a circuit breaker is used
Microservices use circuit breakers more than any other kind of system. A single user request may pass through several services, each calling the next, and a failure in one can ripple backwards through the chain. A breaker on each call boundary stops that ripple, so the user sees a partial result or a clear error instead of a system-wide outage.
Payment systems use circuit breakers to protect checkout. If a payment provider slows down, a breaker stops the flood of payment attempts, letting the shop keep browsing and basket pages working while payments wait or fall back to a queued retry. Customers are annoyed by a delayed payment, but far less so than by a whole shop going offline.
Cloud applications use circuit breakers around calls to databases, queues, and third-party application programming interfaces. These dependencies sit outside the application, over networks the team does not control, so their failures are a matter of when, not if. A breaker turns an external outage into a local, managed problem.
Mobile applications use a simpler form of the same idea. When a phone loses its connection, the application should not keep retrying a request that cannot succeed, draining the battery and freezing the screen. Stopping after a few failures, then trying again later, keeps the application responsive until the connection returns.
Even older, single-system applications benefit from the pattern wherever they call something unreliable, such as a printer, a file share, or an external feed. Any boundary where one component depends on another is a place where a failure can spread, and a breaker at that boundary is a cheap form of insurance.
Strengths and limits
The greatest strength of a circuit breaker is that it contains failure. Instead of every caller hammering a struggling service and making its recovery harder, the breaker gives it breathing room, while callers stay responsive by failing fast and using fallbacks. That containment is what turns a local fault into a minor incident rather than a major outage.
It is also a strength that the pattern is simple to explain and to monitor. Three states, a failure count, and a timer are easy for a team to reason about, and the state of each breaker can be shown on a dashboard, so operators can see at a glance which dependencies are healthy and which are tripped.
The limits are real, though. A breaker adds complexity to every call, its settings need tuning, and a badly chosen fallback can mislead users, for example by showing stale data as if it were fresh. It also cannot help when the failure is inside the calling service itself, or when every fallback depends on the same broken service.
Circuit breaker checklist
- Wrap every call to an external or remote service in a breaker.
- Set a timeout on each call before the breaker sees it.
- Choose a failure threshold based on real traffic, not a guess.
- Give every open breaker a useful fallback, not a blank error.
- Set a reset timeout that gives the service time to recover.
- Allow only a small number of trial calls in the half-open state.
- Log every trip and recovery so failures can be investigated.
- Show breaker state on a dashboard for the operations team.
- Test the breaker by deliberately failing a dependency.
Frequently asked questions
What is a circuit breaker in software?
It is a resilience pattern that watches calls to another service and, when failures reach a threshold, stops sending calls for a while. Instead of waiting for each call to fail, it returns an error immediately, protecting the caller and giving the failing service time to recover.
What are the three states of a circuit breaker?
Closed is the normal state, where calls pass through and failures are counted. Open is the tripped state, where calls are rejected at once. Half-open is the testing state, where a few trial calls check whether the service has recovered before normal traffic resumes.
How is a circuit breaker different from a retry?
A retry repeats a failed call in the hope that the fault was brief, which adds load to the failing service. A circuit breaker does the opposite after repeated failures: it stops calling, which reduces load. Retries suit transient faults, while breakers suit lasting ones.
When should a circuit breaker open?
When failures reach a threshold the team has set, such as a number of failures in a row or a failure rate above a percentage within a short window. A single failure should not trip it, since brief glitches are normal in distributed systems.
What happens when a circuit breaker is open?
Calls are rejected immediately without reaching the service, a behaviour known as failing fast. The caller should handle the rejection with a fallback, such as cached data, a default response, or a clear message to the user.
Do I need a circuit breaker for every service call?
It is most valuable for calls over a network to services you do not control, or to services whose failure could spread. Calls inside a single process, or to a dependency that is essential with no fallback, gain less from it, though the pattern still helps with monitoring.
The bottom line
Circuit breaker explained in one line is this: watch the calls, stop them when they keep failing, and test carefully before letting them through again.
It is a small pattern with an outsized effect, turning the failure of one service into a contained incident instead of a cascade that takes the whole system down.
This article is general information about how the circuit breaker pattern works, not advice about designing resilience for a particular system.







