DOP-C02 Resilient Cloud Solutions Practice Question
A company runs a stateful application on EC2 instances. The application stores session data locally. The instances are behind an ALB with sticky sessions enabled. A scaling event terminates an instance, causing loss of session data. How can the company prevent this while maintaining performance?
⚠ Common exam trap
DOP-C02 often tests the misconception that sticky sessions alone can solve session persistence, but they only tie a user to an instance; they do not prevent data loss when that instance is terminated. Candidates may also think that increasing session duration or using a dedicated instance is sufficient, but these are not scalable or highly available solutions.
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 ElastiCache to store session data
Storing session data in Amazon ElastiCache (Redis or Memcached) externalizes the state from the EC2 instances, so when an instance is terminated during scaling, the session data persists and remains accessible to all instances. This maintains performance because ElastiCache provides sub-millisecond latency and high throughput, and it also allows any instance to handle any request, eliminating the need for sticky sessions. The application must be modified to read/write session data to ElastiCache, but this is the standard AWS-recommended approach for stateful web applications.
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 ElastiCache to store session data
Why this is correct
Storing sessions in ElastiCache moves session state off the instance into a shared, low-latency in-memory tier, so any instance behind the ALB can serve subsequent requests and instance termination no longer destroys session data, while preserving performance.
- ✗
Use a dedicated EC2 instance for sessions
Why it's wrong here
A dedicated instance still holds session state on one host, so its termination or failure loses that data and creates a bottleneck. It is tempting as a simple central store, but the requirement is externalising session state to a shared, durable, horizontally scalable store such as ElastiCache or DynamoDB.
- ✗
Disable sticky sessions
Why it's wrong here
Disabling sticky sessions spreads requests across instances, so a user's session data is not found on whichever instance receives the next request, breaking statefulness. It is tempting because it improves load distribution, but the fix requires externalising session state, not removing the routing affinity that currently masks the problem.
- ✗
Increase the sticky session duration
Why it's wrong here
Extending sticky session duration only lengthens the window before re-routing; the instance is still terminated during scaling, destroying its local session data. It is tempting because it reduces mid-session rebalancing, but it does not address the underlying loss of locally stored state.
Go deeper
Related to this question
About these practice questions
Courseiva writes every DOP-C02 question from scratch — 1,298 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 and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Amazon Web Services exam blueprint
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.