Adapted from this great article
- Fargate runs docker containers serverless. Fargate utilizes Docker containers and runs them virtually.
- Fargate allows you to run containers without having to manage servers or clusters.
- No need to scale, provision or configure clusters of virtual machines to run containers.
- No need to choose server types and how they communicate
- Fargate launch type
- Pack application in containers, specify the memory/CPU requirements, define IAM or network polocies and launch app.
- EC2 launch type
- Define server level, more granular control over the infrastructure, allows you to find best server for app based on requirementss
- No cluster management
- Seamless scaling
- Integration with Amazon ECS
- Abstracts infrastructure = secure container deployments - embed maximum security within a container.
- Lower the costs
- Charges for particular time span app workloads are running
- Able to determine the right number of containers to run on any given host
- Roughly 10% cost reduction
- Reduces complexity
- Build the container image in the first step
- Define resources and images needed for app
- Launch containers and fargate manages infrastructure
- AWS runs containers, scales and manages availability
- EC2 launch type - billing is based on underlying EC2 instances
- EC2 launch type - optimize the process by taking advantage of billing models like spot instances / reserved
- EC2 launch type - customer responsibility to make sure that containers are densely packed onto instances to get max cost benefit . You pay per second - minimum of a minute
- Workload is consistent for CPU or memory - run EC2
- Large cluster of EC2 instances is harder to maintain - if you cant handle it use Fargate
- Small workload - Fargate
- Small test environment - Fargate
- Conisstent periodic tasks from a queue - Fargate