ECS : Elastic Container Service
- Launch Docker containers on AWS
- You must provision and maintain the infrastructure (the EC2 instances)
- AWS takes care of starting / stopping containers
- Has integrations with the Application Load Balancer
Fargate
- Launch Docker containers on AWS
- No need to provision the infrastructure (no EC2 instances to manage)
- Serverless offering
- AWS runs containers for you based on the CPU/RAM you need
ECR - Elastic Container Registry
- Private Docker Registry on AWS
- This is where you store your Docker images so they can be run by ECS or Fargate
Serverless - Lambda
- AWS EC2 vs Lambda
- Easy Pricing:
— Pay per request and compute time
— Free tier of 1 million AWS lambda requests then $0.20 per 1 million thereafter and 400K GBs of compute time means 200 seconds if function is 1GB RAM means 3.2 million seconds, if function is 128MB RAM after that $1 for 600K GB-second
- Integrated with the whole AWS suite of services
- Event Driver: functions get invoked by AWS when needed
- Integrated with many programming languages - Node.js, Python, Java, C# (.net core), Golang, C#/Powershell, Ruby, Custome Runtime API (example Rust)
- Easy monitoring through AWS CloudWatch
- Easy to get more resources per functions (Up to 3GB of RAM)
- Increasing the RAM will also improve CPU and network!
Example 1: Serverless Thumbnail creation
Example 2: Serverless CRON Job
AWS Batch
- Fully managed batch processing at any scale
- Efficiently run 100 thousands of computing batch jobs on AWS
- A batch job is a job with start and an end (opposed to continuous)
- batch will dynamically launch EC2 instances or spot instances
- AWS batch provisions the right amount of compute/memory
- You submit or schedule batch jobs and AWS Batch does the rest
- Batch jobs are defined as Docker images and run on ECS
- Helpful for cost optimizations and focusing less on infrastructure
Example - Image Processing
Lambda vs Batch
- Lambda has time limit, limited runtime, limited temporary disk space and its serverless
- Batch has no time limit, any runtime as log as its packaged as a Docker image. Rely on EBS/instance store for disk space. Batch is not serverless, but its managed service relies on EC2 instances
Lightsail
- Virtual servers, storage, DB and networking at one place
- Low and predictable pricing
- Simpler alternative to using EC2, RDS, ELB, EBS, Route53 etc
- Great for people with little cloud experience
- Can setup notifications and monitoring of your Lightsail resources
- Use cases:
— simple web application (has templates for LAMP, Nginx, MEAN, Node.js etc)
— Website (templates for Wordpress, Magento, Ples, Joomla)
— Dev/Test environment
- Has HA but no auto scaling, limited AWS integration