DVA-C02 Development with AWS Services Practice Question
A developer needs to store temporary session data for a web application running on Amazon EC2 behind an Application Load Balancer. The data must be accessible across multiple EC2 instances. Which AWS service should the developer use?
⚠ Common exam trap
Test-takers frequently confuse 'temporary session data' with 'persistent user data' and choose DynamoDB for its scalability, overlooking that ElastiCache is purpose-built for low-latency, ephemeral storage with automatic eviction policies.
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
✓
Amazon ElastiCache
Amazon ElastiCache is the correct choice because it provides a managed, in-memory caching service (e.g., Redis or Memcached) that can store temporary session data with sub-millisecond latency. Since the data must be accessible across multiple EC2 instances behind an Application Load Balancer, ElastiCache offers a centralized, highly available data store that all instances can read from and write to, ensuring session persistence regardless of which instance handles a request.
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 ElastiCache
Why this is correct
Amazon ElastiCache, offering managed Redis or Memcached, is the optimal choice for storing temporary session data. Its in-memory nature provides sub-millisecond latency and high throughput, crucial for frequently accessed session information. By externalizing session state from individual web servers, ElastiCache enables horizontal scaling of application instances and ensures session continuity even if an instance fails, preventing the need for sticky sessions.
- ✗
Amazon EBS
Why it's wrong here
Amazon Elastic Block Store (EBS) provides persistent block storage volumes that can only be attached to a *single* EC2 instance at a time. This fundamental design makes it unsuitable for storing shared session data, as multiple web servers in an auto-scaling group would need concurrent access to the same session state. Attempting to use EBS for this purpose would introduce significant architectural complexity and fail to meet the requirement for shared, temporary data.
- ✗
Amazon DynamoDB
Why it's wrong here
Amazon DynamoDB is a fully managed NoSQL database service capable of storing session data persistently. However, while highly scalable and durable, its latency profile is typically in the single-digit milliseconds, which is higher than the sub-millisecond latency offered by in-memory caching solutions like ElastiCache. For temporary, high-frequency session data, the higher per-operation cost and latency of DynamoDB make it a less efficient and more expensive choice compared to a dedicated cache.
- ✗
Amazon S3
Why it's wrong here
Amazon S3 is an object storage service designed for highly durable, available, and cost-effective storage of static objects, not for dynamic, low-latency session data. Its HTTP-based API and underlying architecture introduce significant latency overhead, making it impractical for the frequent read/write operations required by active user sessions. Storing temporary session data in S3 would result in a very poor user experience due to slow response times and high operational costs for frequent small object manipulations.
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 →
Same concept, more angles
2 more ways this is tested on DVA-C02
These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.
Variation 1. A developer needs to store session state data for a web application running on multiple EC2 instances. The data must be highly available and durable. Which AWS service should be used?
easy- ✓ A.Amazon ElastiCache
- B.Amazon S3
- C.Amazon EBS
- D.Amazon CloudFront
Why A: Amazon ElastiCache is the correct choice because it provides a managed, in-memory caching service that is ideal for storing session state data with high availability and durability. By using ElastiCache for Redis or Memcached, session data is stored outside of individual EC2 instances, ensuring that if an instance fails, the session state is preserved and can be accessed by other instances in the application tier. ElastiCache supports replication and automatic failover, meeting the requirements for high availability and durability.
Variation 2. A developer wants to store session state data for a web application running on multiple EC2 instances behind an Application Load Balancer. The data is ephemeral and should not persist if an instance is terminated. Which storage option should the developer use?
easy- ✓ A.Amazon ElastiCache
- B.Amazon RDS
- C.Amazon S3
- D.Amazon EFS
Why A: Amazon ElastiCache is the correct choice because it provides an in-memory, high-performance, shared data store (using Redis or Memcached) that is ideal for storing session state. Because ElastiCache is external to the EC2 instances, session data is preserved even if individual EC2 instances are terminated or scaled in/out by an Auto Scaling group. This allows other EC2 instances behind the Application Load Balancer to seamlessly retrieve the user's session state.
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.