Reputation: 1447
I need to design a web app and need me suggestion on infra part. I have decided to use application load balancer, but not sure should I have an API gateway as the entry point to the app or the application load balancer will be used as the entry point?
Also, I'm not sure if the entry point is an application load balancer as it is in private vpc how can I connect the clients of the app in public internet to it?
Please throw some light on the advantages and necessity of using API gateway in front of application load balancer if so.
Upvotes: 7
Views: 8851
Reputation: 706
I need to design a web app and need me suggestion on infra part. I have decided to use application load balancer, but not sure should I have an API gateway as the entry point to the app or the application load balancer will be used as the entry point?
If you just need to route incoming requests to your backend based on path ALB will be sufficient for you. ALB is cheaper than APIGateway in general. If you need some of the service features ( authentication , throttling , caching etc..) you need to support it your backend if you dont use ApiGateway.
Also, I'm not sure if the entry point is an application load balancer as it is in private vpc how can I connect the clients of the app in public internet to it?
Do you mean your backend service hosts are running in private VPC ? If that is the case ALB can not directly forward requests to hosts inside private VPC. You can choose to either 1) Front your hosts with Apigateway 2) Have a set of proxy servers fronted by ALB which will forward requests to NLB inside private VPC. Your actual service hosts will be behind NLB.
Upvotes: 3
Reputation: 116
Vishal explained question 1 very well. Therefore, I am going to touch upon on the second point.
I'm not sure if the entry point is an application load balancer as it is in private vpc how can I connect the clients of the app in public internet to it?
As per my understanding, your ALB is inside the private VPC, and it balances traffic in private subnets. So, you can set up one API Gateway in front of the ALB to extend access to your private VPC resources beyond the VPC boundaries. Then, you should create some form of private integration (e.g., VPC link) (this will be based on the cloud service provider you would use) to encapsulate connections between API Gateway and targeted VPC resources (ALB in this case).
Upvotes: 0