DVA-C02 Development with AWS Services Practice Question
A developer is using AWS Elastic Beanstalk to deploy a web application. The application needs to store session state. Which configuration is MOST cost-effective and scalable?
⚠ Common exam trap
Watch out — candidates often choose local file system storage (D) because it seems simplest and free, overlooking that it fails in auto-scaling environments where instances are ephemeral and session data is not shared.
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 an ElastiCache Memcached cluster
ElastiCache Memcached is the most cost-effective and scalable solution for storing session state because it is an in-memory cache designed for low-latency access, which is ideal for session data that must be frequently read and written. It scales horizontally by adding nodes, and its distributed nature ensures that session data persists across EC2 instance replacements, unlike local storage. This avoids the higher cost and overhead of RDS or the latency and eventual consistency issues of S3 for session management.
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 S3 to store session state
Why it's wrong here
S3 lacks native locking mechanisms for concurrent writes, so simultaneous requests from multiple instances can overwrite session data, causing data loss or corruption. It is tempting because S3 is highly durable and cost-effective for static file storage, and it would be correct for storing large, immutable objects like user-uploaded images or logs where concurrent overwrite conflicts are irrelevant.
- ✓
Use an ElastiCache Memcached cluster
Why this is correct
An ElastiCache Memcached cluster provides a highly scalable, in-memory key-value store perfectly suited for transient session state. Its distributed nature allows multiple EC2 instances in an Elastic Beanstalk environment to access shared session data with very low latency. This ensures user sessions persist even if requests are routed to different instances by a load balancer, enhancing application scalability and user experience.
- ✗
Use an RDS database to store session state
Why it's wrong here
Using an RDS database for session state introduces significant overhead and latency compared to an in-memory solution. Relational databases are optimized for durable, transactional data with strong consistency, which is an overkill for volatile session data. The constant disk I/O, transaction logging, and locking mechanisms required for frequent session reads and writes would bottleneck performance and incur higher costs unnecessarily.
- ✗
Store session state in the local file system of each EC2 instance
Why it's wrong here
Storing session state on the local file system of each EC2 instance creates a severe scalability and reliability problem in a distributed environment. If a user's subsequent request is routed to a different instance by the load balancer, their session will be lost, requiring re-authentication. Furthermore, auto-scaling events or instance terminations will permanently destroy active user sessions, leading to a poor user experience and application instability.
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
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 →
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 is deploying a web application using AWS Elastic Beanstalk. The application needs to store session state. The developer wants to ensure that session data is not lost if an EC2 instance is terminated. Which solution should the developer implement?
medium- A.Store session data in an Amazon EBS volume.
- B.Store session data in an Amazon S3 bucket.
- C.Store session data in the instance store.
- ✓ D.Store session data in an Amazon ElastiCache cluster.
Why D: Amazon ElastiCache provides a managed, highly available, and durable in-memory cache that can store session state externally from EC2 instances. By using ElastiCache (e.g., Redis with replication and persistence), session data survives instance termination because it is stored in a separate, resilient service, not on the local instance.
Variation 2. A developer is deploying a web application using AWS Elastic Beanstalk. The application needs to store session state. Which THREE services can be used for session state storage? (Choose THREE.)
medium- ✓ A.Amazon ElastiCache for Redis
- ✓ B.Amazon DynamoDB
- C.Amazon S3
- D.Amazon CloudFront
- ✓ E.Amazon RDS
Why A: Amazon ElastiCache for Redis, Amazon DynamoDB, and Amazon RDS can all be used to store session state: - **Amazon ElastiCache for Redis** is an in-memory key-value store that provides sub-millisecond latency, making it an ideal and highly performant choice for session state management. - **Amazon DynamoDB** is a fully managed NoSQL database that scales seamlessly and offers single-digit millisecond latency. It is widely used for session state storage (e.g., via the DynamoDB Session State Provider). - **Amazon RDS** is a managed relational database service. While less performant than ElastiCache or DynamoDB, relational databases are frequently used to store session state (especially in legacy or traditional web applications migrating to AWS). Amazon S3 is an object storage service and is not suitable for session state due to higher latency for frequent, small read/write operations. Amazon CloudFront is a content delivery network (CDN) used for caching content at edge locations, not for storing application 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.