SAP-C02 Question 387
Single answerA company is using Amazon ECS to host its containerized application. The application has a strict zero-downtime requirement during deployments. You have been tasked with setting up a CI/CD pipeline using AWS services to deploy new application versions. Which deployment strategy should you use, and why?
- A
Blue/Green deployment using AWS CodeDeploy
- B
All-at-once deployment using AWS CodeDeploy
- C
Rolling update deployment using ECS Service Scheduler
- D
Immutable deployment using AWS CloudFormation
Show answer and explanation
Correct answer: A
Explanation
Blue/Green deployment strategy is best suited for applications with a strict zero-downtime requirement because it deploys the new version in a separate environment (green) while the current version (blue) continues serving traffic. AWS CodeDeploy supports this strategy for ECS services by allowing traffic shifting using Elastic Load Balancers. This ensures that the new version is thoroughly tested before traffic is redirected, minimizing risk and downtime.
- A. Correct.
Blue/Green deployment ensures zero downtime by deploying the new version to a separate environment (green) while the old version (blue) continues serving traffic. After validation, traffic is shifted to the new version. This strategy meets the zero-downtime requirement.
- B. Incorrect.
All-at-once deployment replaces all instances in the environment simultaneously. It is faster but can cause downtime if there are errors in the new version, making it unsuitable for strict zero-downtime requirements.
- C. Incorrect.
Rolling updates replace tasks in the ECS service incrementally. While it minimizes downtime, it doesn't guarantee zero downtime, especially if issues arise during the update process.
- D. Incorrect.
Immutable deployment creates a new stack for the updated version but doesn't inherently guarantee zero downtime for ECS-based applications. It is not the best fit for this scenario.