AWS Certified Developer – Associate — Question 139
A developer is writing a web application that allows users to sign in. The application will run on Amazon EC2 instances behind an Application Load Balancer (ALB). The instances will run in an Auto Scaling group across multiple Availability Zones.
How can the developer ensure that users stay signed in when the Auto Scaling group is scaled down?
Answer options
- A. Enable sticky sessions on the ALB target group.
- B. Create an Amazon DynamoDB table. Configure the application to use the DynamoDB table to store session state such as login status.
- C. Create an Amazon Elastic Block Store (Amazon EBS) volume. Use EBS Multi-Attach to attach the volume to all instances in the Auto Scaling group. Configure the application to use the volume to store session state such as login status.
- D. Enable deregistration delay on the ALB target group.
Correct answer: B
Explanation
The correct answer is B because using Amazon DynamoDB allows for centralized and persistent storage of session states, ensuring that users remain signed in even if instances are scaled down. Options A and D address session management on the ALB level but do not provide a solution for session persistence across instance terminations. Option C, while it suggests using EBS for storage, is not feasible since EBS volumes cannot be shared among multiple instances in a way that maintains session state effectively.