2.1.4.1. Deployment Methodologies for EC2, ECS, EKS, Lambda
First Principle: Selecting a deployment approach that aligns with the service's operational model and your application's availability requirements ensures efficiency and minimizes downtime.
Different AWS compute services require tailored deployment methodologies to ensure efficiency, minimize downtime, and manage risk.
Deployment Methodologies:
- Amazon EC2:
- In-place: Updates application on existing instances. Simple but incurs downtime.
- Rolling Updates: Updates a subset of instances at a time. Reduces downtime.
- Blue/Green: New version deployed to a separate environment; traffic switched. Near-zero downtime, easy rollback.
- Canary: Gradual traffic shift to new version. Controlled risk.
- Amazon ECS/EKS (Containers):
- Rolling Updates: Default for service updates.
- Blue/Green: Achieved via AWS CodeDeploy for ECS, or load balancer/service mesh for EKS.
- Canary: Implemented with load balancer rules or service mesh (e.g., Istio on EKS).
- AWS Lambda (Serverless Functions):
- All-at-once: New version immediately replaces old. Fast, but high risk if issues.
- Linear/Canary Deployments: Using Lambda aliases and AWS CodeDeploy, traffic is shifted gradually (e.g., 10% every 10 minutes). Provides controlled rollout and easy rollback.
Key Deployment Methodologies per Service:
- EC2: In-place, Rolling, Blue/Green, Canary.
- Containers (ECS/EKS): Rolling, Blue/Green, Canary.
- Lambda: All-at-once, Linear/Canary.
Scenario: A DevOps team manages several applications deployed across EC2 instances, ECS containers, and Lambda functions. They need to choose the most appropriate deployment methodology for each, minimizing downtime and managing risk according to the service type.
Reflection Question: Compare and contrast the "Blue/Green" deployment methodology for EC2 applications versus "Linear/Canary" deployments for Lambda functions. How do these approaches achieve similar goals while adapting to the unique operational models of their respective compute services?
Choosing the right methodology is crucial for balancing deployment speed, risk, and application availability.
š” Tip: Leverage AWS CodeDeploy for automating Blue/Green and Canary deployments across EC2, ECS, and Lambda, as it simplifies the orchestration and traffic shifting.