What is the link between a fuse, Netflix and the Cloud ?

What is a Fuse ?

Protects appliances and wiring by monitoring failures

  • Breaks the circuit when current flow is too high

 

  • Needs manual re-set to close the circuit back

What is the Circuit Breaker pattern ?

Protects applications from catastrophic cascade by monitoring for failures

  • Trips the circuit when failures reach a certain threshold

 

  • Implements an automated re wiring process using threshold and half open state

Electric circuit breaker

  • Switch oven on
  • Power overhead
  • Max current limit reached
  • Fuse breaks - no more current flowing
  • You (pissed) go and change the fuse , or press the CB
  • The circuit is closed
  • Time to heat up that pizza, at last !

 

Software circuit breaker

  • Web app making a request
  • Response latency
  • Max failures / timespan reached
  • CB opens - no more request sent
  • Time to try again - CB is half open
  • Transient fault on the remote is resolved
  • Request succeeds - CB is Closed

 

What is Netflix Hystrix ?

Latency and fault tolerance library

Stop cascading failures

Fallbacks and graceful degradation

Fail fast and rapid recovery

=> A real life implementation of the Circuit Breaker Pattern

Cloud Design Pattern

By hkoundi

Cloud Design Pattern

  • 671