Circuit breaker
A guard around calls to a dependency that stops calling it for a while when most recent calls fail, and fails fast instead.
Definition
A breaker tracks recent calls. When the failure or slow-call rate passes a threshold it opens, rejecting calls at once (often with a fallback) so the caller stays responsive and the dependency can recover. After a wait it lets a few test calls through (half-open) and closes again if they succeed. Resilience4j implements it for Java.
In practice
Recommendations time out half of the time; the breaker opens and product pages render without them for 30 seconds.
Learn it in context
Lessons that use this term.