AlgoViz

Circuit breaker

medium 30 min

A circuit breaker watches the calls to one dependency.

Where it shows up

The same pattern appears across everyday software.

  • Houses

    Separate breakers for kitchen, hall and bedrooms: a fault in one room leaves light in the others.

  • Netflix Hystrix

    Wrapped each dependency in a command with its own breaker, pool and fallback, and showed them all on one dashboard.

  • Resilience4j

    A Java library with count-based and time-based windows, a failure rate, a slow-call rate and a set number of half-open calls.

  • Polly

    A .NET library whose breaker uses a failure ratio, a minimum throughput in a sampling time, and a break duration.

  • Envoy outlier detection

    A proxy ejects a single host after a number of consecutive 5xx answers, and takes it back after a while. A breaker per host.

  • Microsoft's pattern catalogue

    The Azure Architecture Center documents the same three states, and describes limited test requests in half-open.