DVA-C02 Development with AWS Services Practice Question
An organization uses AWS CodeCommit for source control and AWS CodeBuild for building a Java application. The build process needs to run integration tests that require a MySQL database. The team wants to ensure the database is provisioned only during the build and cleaned up afterward to minimize costs. What is the most efficient solution?
⚠ Common exam trap
DVA-C02 often tests the misconception that CloudFormation-provisioned RDS is the 'proper' way to get a temporary database — candidates overlook that Docker-in-CodeBuild is faster, cheaper, and truly ephemeral.
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
✓
Use a Docker container running MySQL within the CodeBuild environment.
Running MySQL inside a Docker container within the CodeBuild environment is the most efficient solution because the database is ephemeral, starts and stops with the build, and incurs no persistent infrastructure cost. CodeBuild supports Docker via the privileged mode setting, and the container can be started in the buildspec's pre_build phase and torn down automatically when the build finishes. This satisfies the requirement to provision only during the build and clean up afterward.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Provision a small RDS MySQL instance and keep it running for the build process.
Why it's wrong here
Provisioning a small RDS MySQL instance and keeping it running for the build process is a straightforward but cost-inefficient approach. An RDS instance incurs costs continuously, even during periods when no builds are running or integration tests are not being executed. This 'always-on' cost model contradicts the principle of cost optimization for intermittent testing workloads, leading to unnecessary expenditure.
- ✗
Use AWS CloudFormation to create an RDS instance at the start of the build and delete it at the end.
Why it's wrong here
Using AWS CloudFormation to create and delete an RDS instance for each build is technically feasible but highly inefficient for CI/CD. Provisioning a new RDS instance can take several minutes, significantly increasing overall build times and slowing down the development feedback loop. Furthermore, frequent creation and deletion of AWS resources can potentially lead to API rate limiting issues or resource provisioning delays, making the build process unreliable.
- ✓
Use a Docker container running MySQL within the CodeBuild environment.
Why this is correct
Using a Docker container running MySQL directly within the CodeBuild environment is an efficient and cost-effective solution. CodeBuild supports running services as Docker containers alongside the build environment, allowing MySQL to be spun up quickly and ephemerally for each build. This approach ensures a clean database instance for every integration test run, providing isolation and repeatability without incurring persistent costs for an always-on database.
- ✗
Use Amazon DynamoDB as a substitute for MySQL for the integration tests.
Why it's wrong here
Using Amazon DynamoDB as a substitute for MySQL for integration tests is generally unsuitable due to fundamental architectural differences. MySQL is a relational database requiring SQL queries and a structured schema, whereas DynamoDB is a NoSQL key-value and document database with a different data model and API. Substituting DynamoDB would necessitate significant re-architecting of the application's data access layer and test cases, as existing SQL-based tests would not function.
Go deeper
Related to this question
About these practice questions
One of 1,135 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 →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Amazon Web Services exam blueprint
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.