Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

amazon load balancer for lambda

I am new to use aws.

Normally, I use load balance like bottom with 2 servers.

enter image description here

For L4 Load balancing, there are more than 2 servers

But ALB - Lambda is not I think

I am curious about ALB - Lambda relationship

Is it 1:1? not like L4 switch? or VPCs stand for the server?

And I want to know benefit to use ALB for lambda.

like image 718
USER Avatar asked Oct 26 '25 10:10

USER


1 Answers

Since Lambda is a short running piece of code (FAAS) - Function as a service. The service executes quickly in milli-seconds and dies out. You need to change the way you are thinking about using Lambda, as this doesn't compare to a VPS(virtual private server) or EC2 instance. You have to go with a different approach, called as serverless computing.

Instead, you can have the API Gateway sit on top of the Lambda functions and you can invoke these API's to execute your code. Each lambda function must do only 1 single task and nothing more.

As a matter of fact, the longer a lambda function runs, the costlier it becomes in terms of billing. So having a short running function is the way to keep your bills in check.

If you want to use lambda - try this serverless-stack tutorial - Ref: https://serverless-stack.com/.

Lambda does have outage issues - and the way to handle this is using Route53 Service as a load balancer.

Another good Reference: Ref: https://serverless.com/

like image 146
Magnus Melwin Avatar answered Oct 29 '25 00:10

Magnus Melwin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!