DOP-C02 Resilient Cloud Solutions Practice Question
A company runs a stateful web application on EC2 instances that store session data locally. They want to migrate to a stateless architecture for better resilience. Which TWO actions should they take?
⚠ Common exam trap
A common mix-up: candidates confuse stateless session storage with caching or file storage, incorrectly choosing S3 or EFS because they are persistent, while overlooking the need for low-latency, high-throughput, and consistent access that only DynamoDB or ElastiCache can provide.
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 Amazon DynamoDB to store session data.
DynamoDB provides a fully managed, low-latency, highly available NoSQL database that is ideal for storing session state externally. By moving session data to DynamoDB, the EC2 instances become stateless, allowing any instance to handle any request without relying on local storage, which improves resilience and scalability.
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 Amazon CloudFront to cache session data at the edge.
Why it's wrong here
Amazon CloudFront is a content delivery network that caches static and dynamic web content at edge locations to accelerate delivery. It is not a session store: session data is per-user, constantly changing, and must be read/written from a single authoritative source to avoid stale and inconsistent state. Caching session data at the edge would break session semantics, cause users to be logged out or have corrupted sessions, and provide no durability or atomic update guarantees.
- ✓
Use Amazon DynamoDB to store session data.
Why this is correct
Amazon DynamoDB is a fully managed NoSQL key-value database that delivers single-digit millisecond read/write performance at any scale, making it an excellent external session store. Its fine-grained access control, encryption, backup, and TTL support for automatic item expiration align well with session lifecycle needs. Because DynamoDB is serverless and horizontally scalable, EC2 instances can share session state without statefulness, enabling the application tier to scale freely behind a load balancer.
- ✗
Use Amazon S3 to store session data as objects.
Why it's wrong here
Amazon S3 is an object storage service optimized for storing files, backups, and immutable artifacts, not for high-frequency, low-latency session state. S3 lacks item-level atomic updates and its consistency model can result in stale reads after overwrites, especially under concurrent session access. Moreover, each session update would require a full object PUT with significant overhead, making S3 a poor choice for the continuous read/write pattern required by session data.
- ✓
Use ElastiCache for Redis to store session data externally.
Why this is correct
Amazon ElastiCache for Redis provides an in-memory data store with sub-millisecond latency, atomic operations, and native data structures ideal for session storage. By moving sessions out of EC2 instances into Redis, you decouple state from the compute tier, allowing instances to be replaced or autoscaled without losing user sessions. Configure TTL for session expiration, use cluster mode for horizontal scaling, and enable replication/backups for durability that is typically acceptable for ephemeral session data.
- ✗
Use Amazon EFS to store session data as files.
Why it's wrong here
Amazon EFS is a shared file system that provides NFS-based storage for EC2 instances, but it is not designed for the high-frequency, low-latency item-level updates that session stores require. Session state changes involve thousands of tiny random reads/writes, which perform poorly over network file protocols compared to key-value stores or in-memory caches. Additionally, EFS requires a mounted filesystem and lacks atomic per-session operations, making concurrent writes from multiple instances error-prone and inconsistent.
Go deeper
Related to this question
About these practice questions
This DOP-C02 question is part of Courseiva's 1,487-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam 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 DOP-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 DOP-C02 exam.