Circuit breaker and backpressure
In short: A circuit breaker cuts calls to a broken service so it is not overloaded even further. Backpressure slows senders when the receiver can no longer keep up.
In more detail: When a service is slow or broken, requests pile up and drag callers down (cascading failure). After many errors the circuit breaker switches to “open” and answers immediately with an error or fallback value. After a wait it cautiously tests (“half-open”).
In Depth
- States: Closed (normal), open (blocking), half-open (trial calls).
- Timeouts: Every network call needs one.
- Retries with jitter: Repeats with growing, random wait, otherwise a retry storm arises.
- Bulkhead: Separate resources per caller so one consumer does not block everyone.
- Backpressure: Bounded queues, rejecting (load shedding), reactive streams.
- Fallback: Cached or default answer.
See also: Idempotence, SLI, SLO and error budget