A team is deploying a new web application to EC2 instances using AWS CodeDeploy. They want to minimize deployment downtime by ensuring that traffic is only shifted to the new application version after it has passed a series of health checks. During the deployment, the old version should remain active to serve traffic. Which CodeDeploy deployment type should they choose to meet these requirements?
- AAll-at-once deployment
- BBlue/Green deployment
- CIn-place deployment
- DRolling update deployment
Show answer & explanationAnswer & explanation
Correct answer: B. Blue/Green deployment
Blue/Green deployment with CodeDeploy is designed to minimize downtime by creating a completely new set of instances (green environment) with the new application version, while the old version (blue environment) continues to serve traffic. After the new environment passes health checks, traffic is re-routed to the green environment, and the blue environment can be terminated. This strategy ensures zero downtime during traffic cutover and easy rollback.
Why the other options are wrong
- A. All-at-once deployment updates all instances simultaneously, leading to significant downtime.
- C. In-place deployment updates applications on existing instances, which typically involves downtime or reduced capacity during the update process.
- D. Rolling update deployment updates instances in batches, reducing but not eliminating downtime, and there's no separate 'old' environment serving all traffic during the update.
CodeDeploy Blue/Green Deployment
A deployment strategy where a new version of an application is deployed to a separate, identical environment (green) while the old version (blue) continues to serve traffic. Traffic is shifted to the green environment only after it passes health checks.
- Minimizes downtime and risk.
- Easy rollback by shifting traffic back to the blue environment.
- Requires double the infrastructure during deployment.
- Ideal for critical applications requiring high availability.
Memory trick: Blue is old, Green is new, traffic shifts when Green is true.