Fault tolerance and failover

In a microservices architecture, there might be many reasons for a fault. It is important to handle faults or failovers gracefully, as follows:

  • When the request takes a long time to complete, have a predetermined timeout instead of waiting for the service to respond.
  • When the request fails, identify the server, notify the service registry, and stop connecting to the server. This way, we can prevent other requests from going to that server.
  • Shut down the service when it is not responding and start a new service to make sure services are working as expected.

This can be achieved using the following:

  • Fault tolerance libraries, which prevent cascading failures by isolating the remote instance and services that ...

Get Full Stack Development with JHipster - Second Edition 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.