DEV Community

Shahriyar Al Mustakim Mitul
Shahriyar Al Mustakim Mitul

Posted on

Amazon ECS, Lambda, Fargate

ECS (Elastic Container Service)
In this service, you need to create EC2 instances in advance. AWS takes care of other things.

Image description

Fargate
There is fargate which is a serverless offering and we don't need to create EC2 instances in advance in this case.
Image description
ECR
In AWS we are going to keep our images on ECR (Elastic Container Registry).

Image description

AWS Lambda
It consists of functions and it has short executions and runs on demand.
Image description
Image description
Image description
One common use case is Serverless Thumbnail creation
Image description
Assume one wants to upload a beach picture to an Amazon S3 bucket,a lambda will be triggered and it will create a thumbnail of the picture and send it to the S3. Also, it will create some metadata of the picture and send it to DynamoDB.

another famous common use is Serverless CRON Job.
CRON allows you to define the schedule. Based on the schedule the scripts are run.
CloudWatch Events EventBridge is a serverless offering that triggers Lambda every 1 hour.

Pricing: https://aws.amazon.com/lambda/pricing/
The cost is based on calls and duration.

Image description

Image description

Amazon API Gateway

Assume that you have lambda and DynamoDB connected together and you want a client to get access to Lambda which is not possible because Lambda is not exposed. Now you will have an API Gateway between Client and Lambda so that both of them can connect.

Image description

_AWS Batch _
AWS Batch enables developers, scientists, and engineers to easily and efficiently run hundreds of thousands of batch computing jobs on AWS. AWS Batch dynamically provisions the optional quantity and type of compute resources based on the volumes and specific resource requirements of the batch jobs submitted.
Image description
For example, you upload a picture to Amazon S3 and it will trigger AWS Batch and Batch will call ECS which will already have EC2 and other instances to run your object and then return as required.
Image description

Lambda vs Batch
Image description

Amazon Lightsail
It is basically a package of virtual servers, storage, database, and networking. Generally people uses it if there is no cloud experience of the user.
Image description

Summary
Image description

Top comments (0)