Graph
Circuit Breaker Pattern

🛑Circuit Breaker Pattern

NEW

Prevents repeated calls to failing dependencies by opening a circuit and failing fast until recovery is detected.

DESCRIPTION

The circuit breaker pattern protects systems from cascading failures by monitoring call outcomes and short-circuiting requests during sustained failures. It transitions between closed, open, and half-open states to test recovery. Combined with timeouts and retries, it improves resilience and user experience under partial outages. Metrics such as error rate and latency trigger state changes. Implementations exist in libraries, gateways, and service meshes. Tuning thresholds and fallback strategies are critical to avoid flapping and ensure graceful degradation.

ALTERNATIVE DEFINITIONS

Microsoft

Use this pattern to handle faults that might take a variable amount of time to fix when connecting to a remote service or resource.

Frames the pattern around handling long-lived faults and protecting callers.

Source

Martin Fowler

You wrap a protected function call in a circuit breaker object, which monitors for failures. Once the failures reach a threshold, the circuit breaker trips and future calls fail fast.

Explains classic closed/open/half-open behavior and fail-fast principle.

Source

NGINX

Circuit breaker-style health checks can temporarily stop sending requests to unhealthy upstream servers until they recover.

Shows practical application in gateways and load balancers.

Source

Bulkhead Pattern Timeout Fail Fast Rate Limiting Service Mesh Backoff

COMPETING TERMS

Retry Policy Load Shedding

RELATIONS

KNOWLEDGE AREAS

Software Engineering Data Engineering Infrastructure Cloud

TARGET AUDIENCE

Software Developer DevOps Engineer Data Engineer MLOps Engineer Cloud Architect

EXTERNAL SOURCES

  • Wikipedia - Circuit breaker design pattern
  • Microsoft - Azure architecture pattern summary
  • Martin Fowler - Original thought leadership article
  • Istio - Service mesh circuit breaking task

TOP QUESTIONS

When should I apply the Circuit Breaker Pattern?

Use it when a downstream service exhibits high failure rates or latency spikes, to protect upstream services and users from cascading failures.

Category: Guidance

How does the Circuit Breaker Pattern interact with retries?

Circuit breakers limit retries during outages, while allowing limited probes in half-open state to test recovery.

Category: Concepts

What thresholds trigger a circuit breaker?

Common triggers include error rate, consecutive failures, and latency percentiles. Tune to avoid flapping.

Category: Design

What is a common mistake with the Circuit Breaker Pattern?

Failing to provide fallbacks or graceful degradation leads to hard failures even when the breaker protects the system.

Category: Mistakes

Where is the Circuit Breaker Pattern implemented?

In client libraries, API gateways, and service meshes. Choose where you can consistently enforce policies.

Category: Implementation

How do I monitor a circuit breaker in production?

Track state transitions, error rates, success rates in half-open, and downstream health metrics.

Category: Observability

What are alternatives to the Circuit Breaker Pattern?

Load shedding, bulkheads, and adaptive concurrency control protect systems under load or partial failure.

Category: Alternatives

Can Circuit Breaker Pattern cause outages if misconfigured?

Yes, overly aggressive thresholds may cut off healthy services. Validate with chaos testing and staging.

Category: Risk

How does Circuit Breaker Pattern support user experience?

It fails fast with clear errors or fallbacks, avoiding long timeouts and degraded responsiveness.

Category: Benefits