EC2 Vs ECS Vs Lambda: Elastic Cloud Compute (Ec2)
EC2 Vs ECS Vs Lambda: Elastic Cloud Compute (Ec2)
EC2 Vs ECS Vs Lambda: Elastic Cloud Compute (Ec2)
Working in Domain of instances/manage instances or virtual machine /up and down for your local serve
Picking instances Memory optimize/ cumpute optimize / storage class / GPU processing class
Class like Memory, compute, storage depand on usecase and Size depand on capacity that you need
Feature:
Flexible- you can create instances/ can install databases / wordpress /host
Security
Web application hosing required: load balancer/ target group will associated with auto scaling group
AGS(brings maching ups and down for auto scalling)
Cluster- sets of EC2 machine /still need to mange infrastructure if you use default cluster
Using default ecs is to treat pool of ec2 instances as abstract resources. And we deployed task to cluster
Task can be or long living such as hosting application and reciving traffic and they can be bash
processing task which can take 20 min or 30 minutes
Lambda:
Receive ARN (Amazon source Name) which is unique identifier for your application
Using ARN user invoke landa function and load balancer come in picture which not visible to user but
handle by lamda.
Lamda service reserve pool and it is freedom machine which lamda maintain
Eg: one invocation comes in then you can deploy in EC2 machine and have it back by loadbalancer.
If certain you get brust of request of invocation then lamda will take additional machine from that
reserve pool and assign to load balancer.
If traffic of rquest became less then lamda will reduce ec2 machine from load balancer and put back to
reserve pool. So other service or customer can use.
Why popular
Lamda Edge- helps to deploy lamda function across the global region. No matter from where use
access
Destinations-Allow to pipe your lamda function output directly into aws services like sns and sqs.
Need to write manual code
Layers allow us to use reusuable libraries into lamda function so that it could be share across landa
application.
“lambda:InvokeAsync” asynchronous