Why architecture matters here
Without circuit breakers, one bad dependency kills every caller. With them tuned wrong, they either flap (too sensitive) or protect nothing (too lax). Architecture matters because thresholds + fallback + isolation shape the resilience.
The architecture: every piece explained
The top strip is the states. Caller sends request through Circuit breaker. Closed state passes normally. Open state fast-fails. Half-open state probes recovery.
The middle row is triggers + degrade. Failure threshold — N failures in window opens circuit. Slow-call threshold opens on latency. Fallback returns cached or default. Bulkheads isolate per dependency to prevent cross-contamination.
The lower rows are ops. Observability tracks state transitions. Ops covers tuning + testing + runbook.
End-to-end flow
End-to-end: dependency starts erroring. Failure threshold hits: breaker opens. Callers fast-fail with fallback. Half-open opens after cooldown; single probe; if success, back to closed. If probe fails, back to open. Bulkheads mean upstream dependencies stay healthy.