Architecture mode: circuit breakers

Architecture mode: circuit breakers

problem

How to prevent network or service failures cascade to other services?
 

Program

Service client should invoke a remote service through a proxy, the proxy to the circuit breaker with a similar mode of action. When the number of consecutive failures exceeds the threshold value, the circuit breaker tripped, and within the timeout period, all calls to the remote service attempts will fail immediately. After the timeout expires, a limited number of circuit breaker via the test request. If the request is successful, the circuit breaker to restore normal operation. Otherwise, if that fails, a timeout period starts again.

Related patterns

  • Micro service infrastructure framework may implement this model
  • API gateway will use this model to call the service
  • Server-side router discovery may use this mode to call service

example

  • Netflix Hystrix

 

Guess you like

Origin www.cnblogs.com/paxlyf/p/11289660.html