Problem
When an
application is broken down to smaller microservices, there are a few concerns
that need to be addressed:
- How
to call multiple microservices abstracting producer information.
- On
different channels (like desktop, mobile, and tablets), apps need
different data to respond for the same backend service, as the UI might be
different.
- Different
consumers might need a different format of the responses from reusable
microservices. Who will do the data transformation or field manipulation?
- How
to handle different type of Protocols some of which might not be supported
by producer microservice.
Solution
An API
Gateway helps to address many concerns raised by microservice implementation,
not limited to the ones above.
- An
API Gateway is the single point of entry for any microservice call.
- It
can work as a proxy service to route a request to the concerned
microservice, abstracting the producer details.
- It
can fan out a request to multiple services and aggregate the results to
send back to the consumer.
- One-size-fits-all
APIs cannot solve all the consumer's requirements; this solution can
create a fine-grained API for each specific type of client.
- It
can also convert the protocol request (e.g. AMQP) to another protocol
(e.g. HTTP) and vice versa so that the producer and consumer can handle
it.
- It
can also offload the authentication/authorization responsibility of the
microservice.
No comments:
Post a Comment