How to ensure session persistence during EC2 failure?
A developer is designing a fault-tolerant environment where client sessions will be saved. How can the developer ensure that no sessions are lost if an Amazon EC2 instance fails?
Community Votes
100% of anonymous learners picked answer C. Votes are pick records left by other test-takers — they are not the verified answer.
Community Insight
This question tests the ability to decouple application state from compute resources, with the common trap being confusing sticky sessions (session persistence) with actual data durability.
To prevent session loss during EC2 failures, developers must decouple session data from the instance. The community consensus confirms that Amazon DynamoDB provides the necessary scalability and fault tolerance for session handling.
Choosing Sticky Sessions (Option A) is a common mistake because, while it routes traffic to the same instance, it does not prevent data loss if that specific instance fails.
Community Discussion (3 comments)
Comments & Corrections
No comments yet — spotted an error or have a note? Share it below.
Expert Analysis
Why the Answer Is Correct
Amazon DynamoDB is a managed NoSQL database that offers high availability and durability across multiple Availability Zones. By storing session data in DynamoDB, the data persists independently of the EC2 instance lifecycle. If an instance fails, a new instance can retrieve the session data from DynamoDB without any loss.Why the Other Options Are Wrong
Sticky sessions (Option A) bind a user to one instance; if that instance dies, the session dies. Amazon SQS (Option B) is designed for message queuing between services, not for real-time session state retrieval. Connection draining (Option D) only ensures in-flight requests complete before an instance terminates; it does not save session state.Community Comment Notes
Comment [1] highlights the critical flaw in sticky sessions regarding data loss. Comment [3] reinforces the definition of sticky sessions, helping clarify why it is insufficient for fault tolerance. The community unanimously supports DynamoDB as the robust solution for scalable session handling.Official Reference
Exam Strategy
When questions ask about fault tolerance or data loss prevention regarding sessions, immediately look for options that decouple state from compute. Avoid sticky sessions unless the question specifically asks about maintaining context without requiring persistence across failures.
Related Analysis
Practice All DVA-C02 Questions
Access 100 questions with complete answers and detailed explanations.
View Full DVA-C02 Practice Test →