What is Circuit breakers?
Ask by Anubhav Sharma
Updated 09 Feb 2026
Circuit breakers are a resilience pattern used in software systems to prevent repeated failures from cascading and taking down your whole app.
Think of it like the electrical circuit breaker in your house.
The simple idea
If a remote service (API, database, SMTP server, payment gateway, etc.) keeps failing:
Instead:
That’s a circuit breaker.
Why circuit breakers exist
Without a circuit breaker:
With a circuit breaker:
Circuit breaker states
A circuit breaker has three states:
Closed (normal state)
Open (tripped)
Half-Open (testing mode)
Real-world example
Imagine your Newsletter Worker Service sending emails:
With a circuit breaker:
Circuit breaker vs Retry
These two work together, not against each other:
Best practice:
Circuit breakers in .NET (Polly)
In .NET, circuit breakers are usually implemented using Polly.
Conceptually:
This means:
When should you use circuit breakers?
Use them when calling:
Avoid them for:
Key takeaway