Circuit breaker Flashcards
Reliability
Circuit Breaker
Circuit Breaker: problem
How to prevent a network or service failure from cascading to other services?
Circuit Breaker: solution
A service client should invoke a remote service via a proxy that functions in a similar fashion to an electrical circuit breaker. When the number of consecutive failures crosses a threshold, the circuit breaker trips, and for the duration of a timeout period all attempts to invoke the remote service will fail immediately. After the timeout expires the circuit breaker allows a limited number of test requests to pass through. If those requests succeed the circuit breaker resumes normal operation. Otherwise, if there is a failure the timeout period begins again.
Circuit Breaker: result benefits
Services handle the failure of the services that they invoke
Circuit Breaker: result issues
It is challenging to choose timeout values without creating false positives or introducing excessive latency.
Circuit Breaker: related
The Microservice Chassis might implement this pattern
An API Gateway will use this pattern to invoke services
A Server-side discovery router might use this pattern to invoke services