DOP-C02 Question 398
Single answerYour company hosts a containerized application on Amazon ECS using the Fargate launch type. The application requires frequent updates, and you need to implement a zero-downtime deployment strategy while ensuring that you can roll back quickly in case of issues. What deployment method should you use to achieve this?
- A
Use the rolling update deployment type in ECS.
- B
Use the blue/green deployment strategy with AWS CodeDeploy.
- C
Deploy a new ECS service every time and terminate the old one after testing.
- D
Use the canary deployment strategy with AWS Lambda.
Show answer and explanation
Correct answer: B
Explanation
The blue/green deployment strategy with AWS CodeDeploy is the most suitable approach for achieving zero-downtime deployments in Amazon ECS. It ensures that traffic is routed to the new version only after it has been validated, and it simplifies rollbacks by maintaining the old version until the new one is confirmed stable. This makes it an ideal solution for the given scenario.
- A. Incorrect.
The rolling update deployment type in ECS updates tasks incrementally but does not inherently support instant rollback or traffic shifting between versions, which may result in temporary downtime during updates.
- B. Correct.
The blue/green deployment strategy with AWS CodeDeploy is the best choice for zero-downtime deployments in ECS. It creates a new version of the application (green) while keeping the current version (blue) running. Traffic is shifted only when the new version is verified, and rollbacks are easy since you can direct traffic back to the blue version.
- C. Incorrect.
Deploying a new ECS service for each update is inefficient, error-prone, and does not guarantee zero-downtime. It also lacks a proper mechanism for quick rollbacks.
- D. Incorrect.
The canary deployment strategy with AWS Lambda is used for serverless applications and is not applicable to ECS services running containerized workloads.