← All patterns
Reliability · Architecture pattern

Circuit breaker

Stop repeated calls to a failing dependency and probe recovery deliberately.

The problem

A slow provider occupies callers until their timeouts expire. Automatic retries amplify the pressure.

When it fits

Remote calls can fail for longer than a short retry and the caller has a defined unavailable response or fallback.

The whole architecture

Architecture diagram

A caller protects its dependency boundary with a breaker and an explicit unavailable response.

Blue arrows are calls; gray dotted arrows are breaker state transitions.

100%

Scroll to pan. Select a component for its role.

circuit breaker architectureA caller protects its dependency boundary with a breaker and an explicit unavailable response. Blue arrows are calls; gray dotted arrows are breaker state transitions.Caller protection boundaryRemote dependencycaller → app: requestapp → breaker: guarded callbreaker → provider: permitted callbreaker → unavailable: open → rejectclosed → open: threshold reachedopen → half: cooldown elapsedhalf → closed: healthy probehalf → open: probe failsrequestguarded callpermitted callopen → rejectthreshold reachedcooldown elapsedhealthy probeprobe failsThe caller must handle the declared failure or fallback outcome.CallerOperation requestA breaker complements timeouts and bounded concurrency.ApplicationTimeout / concurrencycapRequests are permitted or rejected according to observed failures and breaker state.Circuit breakerPer-dependency policyA breaker cannot make an unavailable provider succeed.Remote providerIndependent availabilityA fallback requires a product contract and its own capacity.Unavailable resultExplicit failure /fallbackQualifying failures can open the breaker.ClosedAllow calls; count failuresNormal calls do not reach the provider while the breaker is open.OpenFail fast during cooldownProbe success closes the breaker; probe failure reopens it.Half-openLimited recovery probes

Select a component, or focus it and press Enter, to read its role.

Walk through the design

Follow one operation

Select a step to highlight its participants. This conceptual walkthrough is separate from challenge scoring.

Arrows show the conceptual relationships used by this walkthrough.

CallerActive in this stepBreakerActive in this stepProviderActive in this stepUnavailable responseWaiting
Step 1 of 3

Closed: allow calls

The breaker allows the provider call and records its outcome.

Trade-offs to make explicit

  • Failing fast protects caller resources but rejects some calls while the circuit is open.
  • Thresholds, cooldown and probe limits need tuning; a breaker does not make the dependency available.

Failure modes to plan for

  • Unbounded half-open probes can flood a recovering service.
  • A fallback can return stale or inappropriate data; it needs its own product contract and capacity.
Before you build

Explain your decision

Which failures should count toward opening the circuit, and how many recovery probes would you allow?

Use Plan & estimate inside practice to record your assumptions and trade-offs.

Connect concept to practice

Related challenges

Browse challenges →

These links open the original challenges. Existing round unlocks, completions and points apply.

One provider stalled; the others still deliver

Related practice in provider failures and isolation. Circuit state transitions are taught in this lesson; the challenge does not score a breaker.

Open challenge →

Further reading

Microsoft · Circuit breaker ↗

Original PractiseGrid explanations and conceptual diagrams, with primary references for further study. Dedicated scored exercises can be added as coverage grows.