Skip to main content

Circuit Breaker

What a circuit breaker means, why stopping can protect more than retrying, and when opening the circuit is the right move.

Andrews Ribeiro

Andrews Ribeiro

Founder & Engineer

What it is

A circuit breaker stops calling a dependency once it is clearly failing too often.

Instead of keeping the timeout pileup alive, the system “opens the circuit” for a while.

When it matters

This matters in service integrations, external APIs, and any place where slow failure can contaminate the rest of the system.

Without that brake, every stuck request consumes more threads, more connections, and more response time.

Common mistake

The classic mistake is assuming resilience always means trying again.

Sometimes the healthier move is to fail fast, degrade, and protect the rest of the flow.

Short example

Your service calls a payment gateway.

The gateway starts taking 20 seconds or timing out.

After a failure threshold, the circuit breaker opens.

The next calls do not even try the dependency for a while and use another path:

  • degraded response
  • fallback
  • controlled error

Why it helps

A circuit breaker keeps one unhealthy dependency from dragging everything else down.

It does not fix the external service.

It just stops you from dying attached to it.

A resilient system is not the one that retries forever. It is the one that knows when to stop.

You finished this article

Keep exploring

Related articles