Subscribe to the feed

Having a grasp of common architectural patterns is essential to designing software architecture at scale. Using them saves not only time but also ensures a reliable implementation of your design. There’s no need to reinvent the wheel when there’s an architectural pattern available that applies to an architecture you’re developing.

The following is a brief overview of the Circuit Breaker architectural pattern.

Understanding the Circuit Breaker pattern

The Circuit Breaker pattern is one in which an intermediary service is placed between a caller and a target. The purpose of the intermediary service is to observe conditions in the target. Should hazard occur, the circuit breaker process reroutes traffic to another service that has the logic to mitigate the hazardous condition.

diagram circuit breaker pattern between calling service and two services

Analogically, the pattern is similar to a physical circuit breaker for electric lines. When an electric line becomes overloaded and runs the risk of overheating and causing a fire, the circuit breaker trips and stops electricity from flowing through the circuit’s wire.

Pros

  • Using a circuit breaker to respond to the onset of a hazardous condition in a fault tolerant manner is an excellent way to prevent accidents before they happen. 
  • Provides a good way to make systems fault-tolerant at a fine level of activity.

Cons

  • Testing can be harder than it appears. More is required than simply having the circuit breaker close down access to a particular service. A variety of failure responses need to be in force and these responses need to be tested.
  • Circuits are difficult to do as a one-off. They require an infrastructure management technology such as a service mesh that can manage the switching on and off.

Putting it all together

In terms of addressing failure at a general application level, relying on each process in the system to accommodate failure is a time-consuming undertaking. Making updates at the process level is even more laborious. Using the Circuit Breaker pattern in conjunction with a system management technology such as a service mesh allows software architects to take a global approach to creating fail-safe systems.


About the author

Bob Reselman is a nationally known software developer, system architect, industry analyst, and technical writer/journalist. Over a career that spans 30 years, Bob has worked for companies such as Gateway, Cap Gemini, The Los Angeles Weekly, Edmunds.com and the Academy of Recording Arts and Sciences, to name a few. He has held roles with significant responsibility, including but not limited to, Platform Architect (Consumer) at Gateway, Principal Consultant with Cap Gemini and CTO at the international trade finance company, ItFex.

Read full bio
UI_Icon-Red_Hat-Close-A-Black-RGB

Browse by channel

automation icon

Automation

The latest on IT automation for tech, teams, and environments

AI icon

Artificial intelligence

Updates on the platforms that free customers to run AI workloads anywhere

open hybrid cloud icon

Open hybrid cloud

Explore how we build a more flexible future with hybrid cloud

security icon

Security

The latest on how we reduce risks across environments and technologies

edge icon

Edge computing

Updates on the platforms that simplify operations at the edge

Infrastructure icon

Infrastructure

The latest on the world’s leading enterprise Linux platform

application development icon

Applications

Inside our solutions to the toughest application challenges

Original series icon

Original shows

Entertaining stories from the makers and leaders in enterprise tech