The overly complicated API gateway
A single API gateway might be ideal for a small microservices application, but it can turn out to be overly ambiguous if you are dealing with many microservice with various consumers. The following is a list of challenges that are often discussed while exposing APIs using API gateways:
- Each consumer has different information requirements from an API.
- Each consumer has different latency requirements.
- Protocols are supported by each client.
Also, API gateways are implemented as a mechanism to orchestrate backend microservices. The practice, well known as API gateway, is aggregator microservice. This concept is explained, in detail, in Chapter 3, Microservices Architecture Pitfalls. In the following diagram, a single API gateway is implemented to address the various requirements from different consumers:
The API gateway also acts as an aggregator...