Spring / Spring cloud
Explain the Circuit Breaker design pattern.
In the microservice architecture, when one service synchronously invokes another there is always a chance that the other service is unavailable or having high latency. This might cause resource exhaustion, which would make calling service stall and prevent servicing other requests.
Circuit breaker pattern resolve this issue by having service clients invoke a remote service via a proxy. When the number of consecutive failures is more than a threshold, the circuit breaker trips (as in an electric circuit), and for a certain duration (timeout period) all the attempts to invoke the remote service will fail immediately. After the timeout duration expires the circuit breaker performs a limited number of test requests to pass through. If those requests succeed the circuit breaker resumes normal operation, otherwise, the timeout period begins again.
More Related questions...