← All patterns 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 Download SVG 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.
circuit breaker architecture 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. Caller protection boundary Remote dependency caller → app: request app → breaker: guarded call breaker → provider: permitted call breaker → unavailable: open → reject closed → open: threshold reached open → half: cooldown elapsed half → closed: healthy probe half → open: probe fails request guarded call permitted call open → reject threshold reached cooldown elapsed healthy probe probe fails The caller must handle the declared failure or fallback outcome. Caller Operation request A breaker complements timeouts and bounded concurrency. Application Timeout / concurrency cap Requests are permitted or rejected according to observed failures and breaker state. Circuit breaker Per-dependency policy A breaker cannot make an unavailable provider succeed. Remote provider Independent availability A fallback requires a product contract and its own capacity. Unavailable result Explicit failure / fallback Qualifying failures can open the breaker. Closed Allow calls; count failures Normal calls do not reach the provider while the breaker is open. Open Fail fast during cooldown Probe success closes the breaker; probe failure reopens it. Half-open Limited recovery probes API / data call Control / recoverySelect a component, or focus it and press Enter, to read its role.
Breaker scope and qualifying failures are deliberate configuration choices. State transitions here are conceptual; the practice canvas does not score a breaker. Walk through the design
Follow one operation Core flow Failure & recovery
Select a step to highlight its participants. This conceptual walkthrough is separate from challenge scoring.
Arrows show the conceptual relationships used by this walkthrough.
1 Closed: allow calls2 Observe failures3 Open: fail fastStep 1 of 3 Closed: allow calls The breaker allows the provider call and records its outcome.
← Previous Restart Next step →
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.
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.