Courseiva
Troubleshooting and OptimizationhardMultiple ChoiceObjective-mapped

DVA-C02 Troubleshooting and Optimization Practice Question

A company runs a stateful web application on EC2 instances in an Auto Scaling group. Users report that their session data is lost when instances are replaced during scaling events. What is the best solution to preserve session state?

⚠ Common exam trap

Candidates often confuse sticky sessions (option B) with session persistence, not realizing that sticky sessions only maintain request routing to the same instance, not the session data itself when the instance is replaced.

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 ElastiCache as a centralized session store.

ElastiCache provides a centralized, in-memory session store that is external to the EC2 instances. This ensures session data persists independently of the instance lifecycle, so when an instance is replaced during a scaling event, the new instance can retrieve the session from ElastiCache, preserving user state. This is the best solution because it decouples session state from compute resources, aligning with the stateless application pattern recommended for Auto Scaling groups.

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 ElastiCache as a centralized session store.

    Why this is correct

    ElastiCache, particularly Redis, provides an extremely fast, in-memory data store that is ideal for managing user session data. By centralizing sessions here, any EC2 instance can retrieve or update a user's session state with very low latency, ensuring a consistent experience even if the user's subsequent requests are routed to a different application instance. This approach effectively decouples the session state from individual application servers, making the web application highly scalable, resilient to instance failures, and easier to manage in an auto-scaling environment.

  • Enable sticky sessions on the Application Load Balancer.

    Why it's wrong here

    Enabling sticky sessions on an Application Load Balancer (ALB) attempts to maintain state by routing a client's requests consistently to the same EC2 instance. However, this mechanism relies entirely on the continued availability of that specific instance. If the instance fails, is terminated during a scaling event, or replaced due to an update, the session data stored locally on that instance is lost, breaking the user's session and requiring re-authentication. This does not provide a durable or highly available solution for stateful applications.

  • Store sessions in the Application Load Balancer.

    Why it's wrong here

    The Application Load Balancer (ALB) is designed as a stateless, Layer 7 traffic distribution service, not a data storage solution. Its primary function is to efficiently route incoming HTTP/HTTPS requests to healthy backend targets based on configured rules. The ALB does not possess any persistent memory or database capabilities to store application-specific session data, making it architecturally unsuitable for maintaining user session state across requests.

  • Use an S3 bucket to store session data.

    Why it's wrong here

    Amazon S3 is an object storage service optimized for high durability, availability, and scalability of static or large files, not for real-time, low-latency transactional data like user sessions. While S3 can store data, its API operations typically involve higher latency compared to in-memory caches or databases, and its object-based nature is not efficient for frequent, small read/write operations required for session management. Using S3 for session data would introduce significant performance bottlenecks, leading to a poor user experience due to slow session retrieval and updates.

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.