Courseiva
Development with AWS ServiceseasyMultiple ChoiceObjective-mapped

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?

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.

Using CodeBuild's built-in support for Docker, you can run a MySQL container as part of the build. This provides an ephemeral database only during the build process, minimizing cost. Option A is wrong because keeping an RDS instance running incurs ongoing costs even when not in use. Option B is wrong because using CloudFormation to provision an RDS instance at the start of each build and delete it at the end is slower than running a Docker container and may hit API rate limits. Option D is wrong because DynamoDB is a NoSQL database and may not support the SQL queries required by the integration tests.

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.

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.