5 minutes
The disadvantage of AMAZON EC2 is that there are virtual servers in the cloud which need to be managed and which have limited RAM and CPU.
Another Drawback is the cost of continiously running EC2 instance and the extra steps required to scale (add/remove servers)
Advantages of Lambda Over EC2:
Benifits of Lambda (in-general):
Easy Pricing
Integrated with whole AWS Suite of Services.
Event Driven Function gets invoked by AWS when needed.
Integrated with many Programming Languages.
Easy Monitoring through AWS Cloudwatch
Easy to get more resources per function (upto 10GB RAM)
Increasing RAM will also improve CPU & Network
AWS Lambda Supports following Languages:
# Lambda Container Image
If the docker image is compliant (& Implements Lambda Runtime API),
We can run it as a LAMBDA! Although ECS/Fargate are preferred way
if you want to use it.
Following is a nice workflow of an Lambda picking up images from one bucket and creating thumbnail.
But this requires a Trigger (like upload in Bucket), if you want to do a scheduled task, you can use a Serverless CronJob every 1 hour!