Reputation: 5132
How does API Gateway in front of AWS Lambda mimic the architecture and behavior of the Load Balancer in front of Application Servers?
Does API Gateway also take care of load balancing on AWS Lambda containers? Can there be multiple containers for each Lambda function?
Upvotes: 0
Views: 728
Reputation: 35146
API Gateway scales separately to Lambdas, just as Elastic Load Balancers scale separately to application servers.
The Lambda service is responsible for scaling your Lambda function, there can be multiple copies of your Lambda function distributed across MicroVMs in the Lambda infrastructure (although you do not have visibility of this).
To be clear API Gateway is a service that sits in the AWS public zone with no visibility of how it scales, whereas an Elastic Load Balancer is a resource that adds additional nodes inside your subnets as traffic increases.
They might seem like similar services at first glance (an Application Load Balancer can also have a Lambda as a target), however API Gateway is for API management including features such as built in validation models, user throttling models (based on API keys) and more verbose monitoring of verbs/actions to name a few features.
Upvotes: 2