0
votes

Api gateway http://microservices.io/patterns/apigateway.html seems to be a good pattern to be adopted in Micro Service architecture(Not internal communication between services).

But I have below queries

  1. I am unable to understand how API Gateways should be designed itself. We can't have just one api gateway for all services. For example for Uber we have Trip, Cabs, Driver, User, Pricing Micro Services, so how many API Gateways should we design.

  2. In https://medium.com/netflix-techblog/optimizing-the-netflix-api-5c9ac715cf19 what does Dynamic Endpoints means.

I was thinking like in Uber case,to display user first page we will need cabs and pricing. So we will expose an API in api-gateway some /home and from here asynchronously we will call Pricing and Cabs api will merge and return the response. Is there any batter way to do this?

1
Did the answer below helped you? - Fabio Manzano

1 Answers

1
votes

In a cloud architecture, when you have a RESTful interface, you usually have one API Gateway redirecting your requests to a load balancer, serverless function, queue or whatever you want/need: https://docs.aws.amazon.com/apigateway/latest/developerguide/getting-started.html

For communication between microservices, I would suggest a messaging queue for decoupling purposes. Your merge idea could become hard to maintain after some time. Check out SQS: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-tutorials.html