Using the Hystrix library with a reference implementation
Spring Cloud supports Netflix utilities, and Netflix has produced a library based on the circuit-breaker pattern implementation called Hystrix. In a microservice architecture, we can use the Hystrix library to prevent cascading failures, because it is very common in the microservice architecture to have several individual services hosted on different machines across a network. The microservice-based system has multiple layers of service calls.
In a microservice architecture, the failure of a lower-level service can be caused due to the cascading failure of the whole distributed system. So, Netflix Hystrix provides a way to prevent the failure of a whole system by using fallback calls and the developer can provide a fallback. Each circuit-breaker has its own threshold for failure. In Hystrix, if a particular service is called more than circuitBreaker.requestVolumeThreshold
(default: 20 requests) and failure attempt percentage is more...