Looking for API Gateway Technology that call multiple microservices

819 views Asked by At

In my company, we plan to migrate our back-end solution, which is a huge monolith, to a sexier microservices architecture.

So far, we have benchmarked many technologies, and we will probably use the AWS infrastructure with AWS EC2 Container Services (ECS). Our microservices will be wrapped in Docker containers.

We have already deployed containers and configured the auto-scaling and the load balancing. Everything works great.

However, we are looking for an API Gateway technology that could allow us to call multiple microservices with only one request for the client.

The idea is to develop an architecture that looks like Netflix one: http://techblog.netflix.com/2013/01/optimizing-netflix-api.html

For example:

If the client (a web site) wants to fetch the cart of a client. It will send a Get request to the API.

First, I would like that our gateway call the "user" microservice that will return the user's information and the list of the id product that his cart contains:

{
    "name": "john",
    ....,
    "cart": [1,2,3]
}

Then, without directly responding to the client, the gateway will call the "product" microservice to hydrate the Json with the information about each product.

{
    "name": "john",
    ....,
    "cart": [
         {"id": 1, "name": "Iphone", ...},
         {"id": 2, "name": "Ipad", ...},
         {"id": 3, "name": "Ipod", ...}
    ]
}

So, my question is do you know a nice technology that could do the job ?

1

There are 1 answers

0
Mark B On

You would use AWS Lambda for this. Have API Gateway call a Lambda function. Have the Lambda function perform the actions you have described, calling your ECS services, and then return the final result.