AWS Certified Solutions Architect - Associate / Question #1228 of 1019

Question #1228

A solutions architect is designing a highly available web application on AWS using EC2 instances in an Auto Scaling group across multiple Availability Zones. The application requires maintaining user session data across requests, especially during scaling events. The architect must ensure that session data is not lost when instances terminate and can be accessed by any instance. The company is willing to modify the application code as needed.

What should the solutions architect recommend to manage session data effectively?

A

Store session data in Amazon ElastiCache.

B

Enable sticky sessions on the Application Load Balancer.

C

Use Amazon EBS volumes to persist session data.

D

Implement AWS CloudFront to cache session data.

Explanation

The correct answer is A. Store session data in Amazon ElastiCache.

Why A is correct:
- ElastiCache (Redis/Memcached) offers a managed, highly available, and scalable in-memory data store. By storing session data here, all EC2 instances in the Auto Scaling group can access it, ensuring session persistence even if instances terminate. Modifying the application to read/write sessions to ElastiCache ensures data is not lost and remains accessible across scaling events.

Why other options are incorrect:
- B (Sticky sessions): Sticky sessions route requests to the same instance, but session data stored locally is lost if the instance terminates.
- C (EBS volumes): EBS volumes are tied to a single instance and cannot be shared across instances dynamically, making them unsuitable for multi-AZ scaling.
- D (CloudFront): CloudFront caches static content at the edge, not dynamic session data, and does not solve the persistence requirement.

Key Points:
- Use managed services like ElastiCache for shared, persistent session storage.
- Avoid instance-specific storage (EBS) or routing (sticky sessions) for HA applications.
- Application code must be updated to integrate with the chosen session management solution.

Answer

The correct answer is: A