Circuit breaker
A guard around calls to a dependency that stops calling it after repeated failures and fails fast until it recovers.
When a dependency slows down, callers pile up waiting on it and run out of threads or connections themselves. A breaker counts failures; past a limit it opens and returns an error or a fallback at once. After a pause it lets a few test calls through (half-open) and closes again if they succeed. It protects both your service and the struggling dependency.
Related terms
- Retry with exponential backoff and jitter: Retrying a failed call after waits that grow each time, with some randomness added so many clients do not retry at the same moment.
- Bulkhead pattern: Giving each dependency or workload its own limited pool of connections or workers, so one slow part cannot use up everything.
- Graceful degradation: Keeping the core of a product working when a dependency fails, by switching off or simplifying the parts that rely on it.
