You are on page 1of 9

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)

ECS( elastic container store): will explain later in details

Which already embedded on docker eco system(dockor container).

Ecs model operates on cluster and task

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:

Its functional level


How lamda function works:

User upload code for application

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.

Before service route to process

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 new features:

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.

Provisioned Concurrency( Cold Start) : make application available with no lag.


Invoke one lamda from another lambda

“lambda: InvokeFunction”  synchronous

“lambda:InvokeAsync”  asynchronous

Resource - can be policy

You might also like