Hystrix is a fault tolerance library that is very useful for managing failures in a distributed environment like microservices. Suppose we have a service A
dependent on service B
, which is in turn dependent on service C
.
A -> B -> C
Let’s say a call is made from A
to B
. To serve this request, B
needs to call C
but there’s a communication failure between them. If the call from B
to C
is wrapped in Hystrix mechanism, we prevent the failure being propagated to A
. Because B
couldn’t fetch the actual information from C
, Hystrix gives us the option of declaring a fallback value to be used in this case, if feasible.