2.1.1.5. Deployment Strategies Overview (CodeDeploy)
First Principle: Deployment strategies manage the inherent risk of introducing changes into production, prioritizing availability and rapid recovery.
AWS CodeDeploy automates application deployments to various compute services like Amazon EC2, AWS Fargate, AWS Lambda, and on-premises servers. Understanding different deployment strategies is crucial for minimizing downtime and managing risk.
Common Deployment Strategies (supported by CodeDeploy):
- In-place deployment: Stops the application on each instance, deploys the new version, and restarts the application. Causes downtime.
- Rolling update: Deploys the new version to a subset of instances at a time, gradually replacing the old version. Reduces downtime but can be slow.
- Blue/Green deployment: Runs two identical environments (Blue for old version, Green for new). Traffic is switched from Blue to Green once Green is validated. Provides zero downtime and instant rollback.
- Canary deployment: A subset of Blue/Green where new version is rolled out to a small percentage of users first, then gradually to all. Minimizes impact of issues.
Key Deployment Strategy Characteristics:
- In-place: Simplest, highest downtime.
- Rolling: Reduced downtime, gradual.
- Blue/Green: Zero downtime, instant rollback, higher complexity.
- Canary: Minimal blast radius, gradual rollout, highest complexity.
Scenario: A DevOps team needs to deploy a new version of a critical web application. They require a deployment strategy that minimizes downtime to near zero and allows for immediate rollback in case of any issues with the new version.
Reflection Question: Why would a Blue/Green deployment strategy be the most suitable for this critical web application, and how does it ensure near-zero downtime and immediate rollback capability?
Choosing the right strategy depends on your application's availability requirements and risk tolerance.
š” Tip: For critical applications, prioritize Blue/Green or Canary deployments to minimize downtime and enable quick rollbacks.