Circuit breaker
Definition
A circuit breaker temporarily interrupts calls to a faulty service to limit repeated failures and consequential loads.
A circuit breaker is a design pattern for accessing failure-prone dependencies. After defined error conditions, it temporarily blocks further calls and later allows controlled attempts. This prevents an application from continuously waiting on an already visibly disrupted service; it does not fix the cause.
Simply explained
If a service repeatedly fails, the application pauses instead of repeatedly knocking unsuccessfully.
Why it matters in practice
The pattern can conserve resources and prevent a single failure from overloading other parts of a distributed application.
Example from business
Example: A portal temporarily interrupts querying an external service after repeated errors and displays a comprehensible fallback message.
Limits and pitfalls
- Inappropriate thresholds can unnecessarily block healthy services or react too late. Restart and meaningful fallback behavior must be planned accordingly.
Origin & history
Circuit breaker belongs to resilience patterns of distributed systems. Unlike a pure retry loop, it consciously limits further access attempts.
Use in mid-sized companies
- Medium-sized companies can connect external interfaces so that their failures do not uncontrollably affect the entire own application.
Frequently asked questions
Does a circuit breaker replace retry attempts?
Not fundamentally. Both patterns fulfill different tasks and can be coordinated and combined without causing unlimited retries.
Sources
- Circuit Breaker pattern. · Microsoft (o. J.): Circuit Breaker pattern.
Editorially reviewed on: