DVA-C02 Deployment Practice Question
A team is using AWS CodeBuild to compile and test code. The build takes longer than expected. The team wants to reduce build times by caching dependencies. Which option should the team use to cache dependencies in CodeBuild?
⚠ Common exam trap
Test-takers frequently confuse caching mechanisms with storage services like DynamoDB or EFS, or assume that ECR (used for container images) can cache dependencies, when CodeBuild specifically supports only local and S3 caching for dependency reuse.
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
✓
Local caching or Amazon S3 caching
AWS CodeBuild supports two caching modes: local caching and Amazon S3 caching. Local caching stores dependencies on the build host's local file system, while S3 caching stores them in an S3 bucket. Both options reduce build times by reusing previously downloaded dependencies across builds, avoiding redundant downloads.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Amazon DynamoDB
Why it's wrong here
Amazon DynamoDB is a fully managed NoSQL database service, designed for high-performance, scalable storage and retrieval of structured and semi-structured data for applications. It is not engineered or intended for caching build dependencies, intermediate artifacts, or compiled outputs within a CI/CD pipeline like AWS CodeBuild. Its primary function is persistent data storage, not ephemeral build environment state or large binary files for build acceleration.
- ✗
Amazon EFS
Why it's wrong here
Amazon EFS provides scalable, elastic, shared file storage that can be mounted by multiple EC2 instances and other AWS services. While it is a file system, AWS CodeBuild's native caching mechanisms are specifically implemented for either local disk persistence within the build environment or object storage in Amazon S3. EFS is not a supported or recommended caching solution for CodeBuild, as it introduces network latency and is not integrated into CodeBuild's optimized caching workflows for build artifacts and dependencies.
- ✗
Amazon ECR
Why it's wrong here
Amazon ECR (Elastic Container Registry) is a fully managed Docker container registry that allows developers to store, manage, and deploy Docker container images. These images serve as the base environment for CodeBuild projects, defining the tools and operating system available during the build. However, ECR is not designed for caching build dependencies, downloaded packages, or compiled outputs generated during the build process itself; its purpose is solely for container image management.
- ✓
Local caching or Amazon S3 caching
Why this is correct
AWS CodeBuild natively supports both local caching and Amazon S3 caching to significantly speed up build times. Local caching stores a cache directory on the build host's file system, reusing dependencies across subsequent builds on the same host. Amazon S3 caching, a more scalable option, uploads and downloads a compressed cache archive to and from an S3 bucket, making the cache available across different build hosts and providing durability and shareability for build dependencies and artifacts.
Quick reference
AWS S3 Storage Class Comparison
| Storage Class | Min Duration | Retrieval | Use Case |
|---|---|---|---|
| S3 Standard | None | Immediate | Frequently accessed data |
| S3 Standard-IA | 30 days | Immediate | Infrequent access, rapid retrieval |
| S3 One Zone-IA | 30 days | Immediate | Non-critical infrequent data |
| S3 Intelligent-Tiering | None | Immediate–hours | Unknown or changing access patterns |
| S3 Glacier Instant | 90 days | Milliseconds | Archive with instant retrieval |
| S3 Glacier Flexible | 90 days | Minutes–hours | Archive, flexible retrieval |
| S3 Glacier Deep Archive | 180 days | Hours | Long-term compliance archive |
Go deeper
Related to this question
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 →
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.