Courseiva
DeploymentmediumMultiple ChoiceObjective-mapped

DVA-C02 Deployment Practice Question

A company uses AWS CodeBuild to run tests and build artifacts for a Java application. The build process is taking longer than expected. The developer wants to speed up the build by caching dependencies. What should the developer do?

⚠ Common exam trap

Watch out — candidates often assume external storage (S3 or EFS) is required for caching, but CodeBuild's built-in local caching is specifically designed for this purpose and avoids the latency of network-based storage.

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

Enable local caching in the CodeBuild project configuration.

CodeBuild's local caching feature allows the build environment to cache dependencies (e.g., Maven local repository) in a local directory that persists across build runs for the same project. This eliminates the need to re-download dependencies on every build, significantly reducing build time. The cache is stored on the build instance's local storage and is automatically managed by CodeBuild.

Answer analysis

Option-by-option breakdown

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

  • Use a CodeCommit repository to store dependencies.

    Why it's wrong here

    AWS CodeCommit is a version control service specifically designed for storing and managing source code, not for caching or storing large binary dependencies like compiled libraries or package manager artifacts. Storing build dependencies such as JAR files or npm modules directly within a Git repository would drastically increase its size, leading to significantly slower clone operations for every build. This approach is inefficient, costly, and fundamentally misuses a version control system for dependency management, which is better handled by package managers and dedicated caching solutions.

  • Store dependencies in an S3 bucket and download them in each build.

    Why it's wrong here

    While Amazon S3 can serve as a repository for storing build artifacts, relying on it to store dependencies and downloading them in each CodeBuild run does not provide true caching benefits for accelerating builds. Every new build environment would still incur the full network latency and data transfer time required to download potentially large dependency sets from S3, even if those dependencies have not changed. This method is inherently slower than a local caching mechanism, as it doesn't leverage local persistence within the build environment to avoid repeated network I/O.

  • Enable local caching in the CodeBuild project configuration.

    Why this is correct

    Enabling local caching in the CodeBuild project configuration is the most effective and direct solution for significantly speeding up build times by reusing previously downloaded dependencies. CodeBuild offers various local caching options, including caching artifacts in the build host's Docker layer or a specified local directory, or even using an S3 bucket for more persistent, shared caching. This mechanism ensures that common dependencies are stored and quickly retrieved for subsequent builds, drastically reducing network I/O, package installation times, and overall build execution duration.

  • Mount an Amazon EFS file system to the build environment and store dependencies there.

    Why it's wrong here

    Mounting an Amazon EFS file system to the CodeBuild environment for dependency storage introduces unnecessary complexity and potential performance bottlenecks compared to CodeBuild's native caching. EFS is a network file system, meaning dependency access would still involve network latency, which can be slower than direct local disk I/O within the build container. Furthermore, managing an EFS file system for transient CodeBuild environments adds operational overhead and cost without providing the optimized, low-latency caching benefits inherent to CodeBuild's built-in local caching features.

Quick reference

AWS S3 Storage Class Comparison

Storage ClassMin DurationRetrievalUse Case
S3 StandardNoneImmediateFrequently accessed data
S3 Standard-IA30 daysImmediateInfrequent access, rapid retrieval
S3 One Zone-IA30 daysImmediateNon-critical infrequent data
S3 Intelligent-TieringNoneImmediate–hoursUnknown or changing access patterns
S3 Glacier Instant90 daysMillisecondsArchive with instant retrieval
S3 Glacier Flexible90 daysMinutes–hoursArchive, flexible retrieval
S3 Glacier Deep Archive180 daysHoursLong-term compliance archive

About these practice questions

Courseiva writes every DVA-C02 question from scratch — 724 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. 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.