Circuit Breaker Pattern

Soumendra's Blog
6 min readMar 31, 2019

Overview

A Soviet/Russian 100kV three single phase oil Circuit Breaker. (Do not judge the size of a Circuit breaker by its cover photo)

According to Wikipedia the definition of Circuit Breaker in Electrical technology.

A circuit breaker is an automatically operated electrical switch designed to protect an electrical circuit from damage caused by excess current from an overload or short circuit. Its basic function is to interrupt current flow after a fault is detected. Unlike a fuse, which operates once and then must be replaced, a circuit breaker can be reset (either manually or automatically) to resume normal operation.

And in Software designing:

A Circuit breaker is a design pattern used in modern software development. It is used to detect failures and encapsulates the logic of preventing a failure from constantly recurring, during maintenance, temporary external system failure or unexpected system difficulties.

Though the name of this pattern borrowed from Electrical Engineering, in the Software world the Circuit breaker (CB) design pattern can do much more than just tripping a circuit with failures like:

  • In between fully opened and fully closed state, CB can have an intermediate state, called Half-open state where an application can operate at degraded functionalities
  • Automatic checking of the state of the application is possible.

--

--

Soumendra's Blog
Soumendra's Blog

Written by Soumendra's Blog

Lead MLOps Engineer at Freshworks.

No responses yet