AWS Certified Developer – Associate (DVA-C02) — Question 375
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?
Answer options
- A. Use sticky sessions with an Elastic Load Balancer target group.
- B. Use Amazon SQS to save session data.
- C. Use Amazon DynamoDB to perform scalable session handling.
- D. Use Elastic Load Balancer connection draining to stop sending requests to failing instances.
Correct answer: C
Explanation
Storing session data off-instance in a highly available, distributed database like Amazon DynamoDB ensures that the session state remains intact even if an Amazon EC2 instance fails. Sticky sessions still bind the user to a specific instance, meaning an instance failure would result in session loss. Amazon SQS is designed for message queuing rather than fast session state retrieval, and connection draining only helps gracefully terminate instances but does not preserve session state for sudden failures.