O'Reilly logo

TypeScript Microservices by Parth Ghiya

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Handling partial service failures

Yet another need to address is handling partial failures. When one service calls another service it may not receive a response at all or it may get delayed response. With the increased number of services, any service may go down at any point in time. API Gateway should be able to handle partial failures by implementing some/all of the following strategies:

  • Asynchronous mode of communication by default. Using synchronous mode only when needed.
  • A number of retries should be handled with exponential backoffs that is 1, 2, 4, 16, and so on.
  • Well defined network timeouts to prevent blocking of resources.
  • Circuit breaker pattern to trip the request if service is down or overloaded.
  • Fallbacks or returning cached ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required