Member-only story

Circuit Breaker in Laravel (Microservices)

Prateek Mishra
5 min readSep 23, 2023

--

If your Laravel application depends on remote calls for work, consider implementing a Circuit Breaker. This post will show you a package I developed that you can import into your Laravel/PHP project.

Circuit Breaker (Diagram).

What is a Circuit Breaker?

Developers love to use names from the real world and bring them to their Software. A Circuit Breaker is another example; you may have heard this word before when talking to your electrician.

When I worked as an Electrician (thousand years ago), I installed a few of them, and compared to this new virtual version, the purpose is almost the same.

In short, a Circuit Breaker is designed to control the workflow of an electrical circuit. Given a specific circumstance/condition, it will keep closed or open, and the electricity will stop flowing.

In the Software world, the only difference is that the circuit is your application; from the first line, it starts running until the last one. Then, the Circuit Breaker is a small component that can be put in any part of the application and control the workflow. Consider it a…

--

--

Prateek Mishra
Prateek Mishra

Written by Prateek Mishra

I am a tech enthusiast who thrives on experimenting with cutting-edge technologies

No responses yet

Write a response