Courseiva
DeploymenthardMultiple ChoiceObjective-mapped

DVA-C02 Deployment Practice Question

A developer is using AWS CodeDeploy with a blue/green deployment strategy to update an application running on Amazon ECS with the Fargate launch type. After the new (green) task set is created and traffic is shifted to it, users immediately report errors when trying to write data. The developer discovers that the green task set is connecting to a different database than the blue task set. The database endpoints are configured in the ECS task definition. What is the simplest way to prevent this issue in future deployments?

⚠ Common exam trap

Watch out — candidates often think the issue is about traffic routing or session persistence (options B or C), rather than recognizing that the root cause is a configuration mismatch in the task definition environment variables, which is a common oversight in blue/green deployments.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Modify the blue/green deployment configuration to use the same database endpoint for both task sets by updating the environment variables in the task definition before deployment.

The issue stems from the green task set using a different database endpoint than the blue task set, which is configured via environment variables in the ECS task definition. By updating the task definition to use the same database endpoint before deployment, both task sets will connect to the same database, ensuring consistency during the traffic shift. This is the simplest fix as it requires no additional infrastructure or complex routing changes.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Modify the blue/green deployment configuration to use the same database endpoint for both task sets by updating the environment variables in the task definition before deployment.

    Why this is correct

    During an AWS CodeDeploy blue/green deployment, both the existing (blue) and new (green) application versions must access the same persistent data store to maintain data consistency. By updating environment variables within the ECS task definition, such as `DATABASE_ENDPOINT`, before deployment, both task sets can be configured to point to the single, shared database instance. This approach avoids data migration complexities and ensures a seamless transition without modifying the container image itself, making it the most straightforward and efficient solution for database connectivity.

  • Create two separate Amazon RDS databases and use an Amazon Route 53 weighted routing policy to distribute traffic.

    Why it's wrong here

    Creating two separate Amazon RDS databases for a single application during a blue/green deployment introduces significant data consistency challenges and operational overhead. Each task set would write to its own database, leading to data divergence and requiring complex, error-prone synchronization mechanisms or data migration upon cutover. Furthermore, using Route 53 weighted routing only distributes application traffic; it does not address the fundamental requirement of a shared, consistent data layer for both deployment environments, making this an impractical and costly solution.

  • Use an Application Load Balancer (ALB) with stickiness to route each user to the correct task set.

    Why it's wrong here

    While Application Load Balancer (ALB) stickiness ensures that a user's subsequent requests are routed to the same target group and underlying task set for session continuity, it does not resolve the application's database connectivity requirements. Stickiness is a client-side session management feature and has no bearing on which backend database the application instances themselves are configured to connect to. Both the blue and green task sets still require a consistent configuration to access a single, shared database endpoint, which stickiness cannot provide.

  • Use AWS CloudFormation to create a new database stack for each deployment and update the task definition dynamically.

    Why it's wrong here

    Utilizing AWS CloudFormation to provision a new database stack for each application deployment is an overly complex and fundamentally flawed approach for maintaining persistent application data. This strategy would necessitate either losing all application data with each deployment or implementing intricate, continuous data migration processes between newly created databases, which is antithetical to the purpose of a blue/green deployment aiming for zero downtime and data consistency. Blue/green deployments typically rely on a single, stable data store, making dynamic database provisioning per deployment unnecessary and highly inefficient.

About these practice questions

One of 724 original DVA-C02 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This DVA-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DVA-C02 exam.