Konubinix' opinionated web of thoughts

Circuit Breaker


circuit breaker, you set limits for calls to individual hosts within a service, such as the number of concurrent connections or how many times calls to this host have failed. Once that limit has been reached the circuit breaker “trips” and stops further connections to that host. Using a circuit breaker pattern enables fast failure rather than clients trying to connect to an overloaded or failing host.


basic idea behind the circuit breaker is very simple. You wrap a protected function call in a circuit breaker object, which monitors for failures. Once the failures reach a certain threshold, the circuit breaker trips, and all further calls to the circuit breaker return with an error, without the protected call being made at all. Usually you’ll also want some kind of monitor alert if the circuit breaker trips


resetting behavior by trying the protected call again after a suitable interval, and resetting the breaker should it succeed


useful technique to avoid overloading servers


avoid waiting on timeouts for the client, and a broken circuit avoids putting load on a struggling server


Notes pointant ici