Courseiva
Development with AWS ServiceshardMultiple ChoiceObjective-mapped

DVA-C02 Development with AWS Services Practice Question

A company runs a containerized application on Amazon ECS using the Fargate launch type. The application needs to store temporary data that must persist across container restarts but does not need to be shared across multiple tasks. The data should be automatically deleted when the task stops. Which storage option should the developer use?

⚠ Common exam trap

It's easy for candidates to confuse 'persist across container restarts' with 'persist across task stops,' leading them to choose Amazon EFS or EBS, which are designed for long-term persistence, while Fargate's ephemeral storage perfectly meets the temporary, task-scoped requirement.

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 the ephemeral storage provided by Fargate.

Fargate provides ephemeral storage (up to 20 GB by default) that persists data across container restarts within the same task but is automatically deleted when the task stops. This matches the requirement for temporary data that does not need to be shared across tasks and is cleaned up upon task termination.

Answer analysis

Option-by-option breakdown

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

  • Attach an Amazon EBS volume to the task.

    Why it's wrong here

    Amazon EBS volumes are block storage devices designed for traditional EC2 instances, providing persistent storage that can be attached and detached. Fargate, as a serverless compute engine for containers, abstracts away the underlying infrastructure, including the host EC2 instance. Therefore, directly attaching an EBS volume to a Fargate task is not supported, as Fargate tasks do not have dedicated, user-manageable EC2 instances to which EBS volumes can be mounted.

  • Use the ephemeral storage provided by Fargate.

    Why this is correct

    Fargate tasks are provisioned with a certain amount of ephemeral storage, typically 20 GB by default, which is local to the task's underlying compute environment. This storage is designed for temporary data, such as application logs, caches, or scratch space, and persists for the entire lifecycle of the Fargate task. While it is deleted once the task stops, it remains available and consistent across restarts of individual containers within that same task, making it suitable for short-lived data that doesn't require long-term persistence.

  • Mount an Amazon EFS file system to the container.

    Why it's wrong here

    Amazon EFS provides a scalable, shared, and highly available network file system that can be mounted by multiple Fargate tasks concurrently. While EFS offers persistent storage that extends beyond the lifecycle of individual tasks, making it suitable for shared data or stateful applications, it introduces additional complexity and cost compared to ephemeral storage. For temporary data that does not require persistence across task restarts or sharing among multiple tasks, EFS would be an over-engineered solution.

  • Create a Docker volume using the 'tmpfs' driver.

    Why it's wrong here

    A Docker 'tmpfs' volume creates a temporary file system in the host's memory, providing extremely fast I/O. However, data stored in a 'tmpfs' volume is entirely non-persistent; it is lost immediately if the container stops or restarts, and certainly does not persist across the entire Fargate task lifecycle. This makes 'tmpfs' unsuitable for any data that needs to survive even a container restart within the same task, let alone for data that needs to persist for the duration of the task.

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.