Using Circuit Breaker in software with microservice architecture

DOI: 10.31673/2412-9070.2022.013133

Authors

  • А. М. Тушич, (Tushych A. M.) State University of Telecommunications, Kyiv

DOI:

https://doi.org/10.31673/2412-9070.2022.013133

Abstract

Microservices is an architectural style in which one program is created as a set of small programs, each of which works in its own process and interacts with others using simple and fast data transfer protocols. In addition to many advantages, this method of designing an architecture has an important disadvantage: if the system runs many separate services, any software node can fail and cause a cascade of errors. To prevent the spread of cascading termination of microservices, Circuit Breaker is used — a library of fault tolerance, which describes the strategy of preventing cascading failure at different levels of the program and monitors the methods of unsuccessful calls to relevant services. The library will keep failures down to a certain threshold. In addition, it leaves the chain open. This means that all subsequent calls will be redirected to the backup method to prevent future failures. This creates a temporary buffer for the associated service to restore the fault state. The architecture of the microservice should provide for errors, but Circuit Breaker is designed for less expected errors, which can last much longer: network failure, service failure, hardware, and so on. In these situations, when we try to send a similar request again, we will most likely get a similar error. The paper describes the schemes of using Circuit Breaker and recommendations for correct operation.

Keywords: microservice architecture; proxy service; Circuit Breaker; switch; fault tolerance.

References
1. A Guide to Spring Cloud Netflix – Hystrix [Електронний ресурс]. URL: https://www.baeldung.com/spring-cloud-netflixhystrix
2. Circuit Breaker pattern [Електронний ресурс]. URL: https://docs.microsoft.com/ru-ru/azure/architecture/patterns/circuit-breaker
3. Стратегії обробки помилок: Circuit Breaker pattern [Електронний ресурс]. URL: https://medium.com/@kirill.sereda/%D1%81%D1%82%D1%80%D0%B0%D1%82%D0%B5%D0%B3%D0%B8%D0%B8-%D0%BE%D0%B1%D1%80%D0%B0%D0%B1%D0%BE%D1%82%D0%BA%D0%B8-%D0%BE%D1%88%D0%B8%D0%B1%D0%-BE%D0%BA-circuit-breaker-pattern-650232944e37
4. Circuit Breaker паттерн [Електронний реcурс]. URL: https://bool.dev/blog/detail/circuit-breaker-pattern
5. Техніки обробки відмов сервісу в мікросервісних архітектурах або Альтернативи Circuit Breaker [Електронний ресурс]. URL: https://habr.com/ru/company/arcadia/blog/571442/
6. Tushych A. M. Analysis of problems of production modernization through implementation of IT technologies // Economic trends: new opportunities and threats: International scientific conference. Le Mans, France: Le Mans University, 2021. November 19-20, 2021. Р. 58–61.
7. Tushych A. Analysis of the main problems in the field IT today // The ІV International Scientific and Practical Conference «Actual problems of practice and science and methods of their solution». Milan, Italy, 2022. January 31 – February 02, 2022. Р. 581–582.

Published

2022-12-08

Issue

Section

Articles