Circuit breakers and dashboard

To limit the duration of operations, we can use timeouts. Timeouts can prevent hanging operations and keep the system responsive. However, using static, fine-tuned timeouts in microservices communication is an anti-pattern; we are in a highly dynamic environment where it's almost impossible to come up with the right timing limitations that work well in every case.

Circuit breakers insulate a service from its dependencies by preventing remote calls when a dependency is determined to be unhealthy, just as electrical circuit breakers protect homes from burning down due to excessive use of power. Circuit breakers are implemented as state machines:

Figure 35: Circuit breaker workflow

In the closed state, all calls ...

Get Cloud Foundry for Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.