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 ...