SAP-C02 Question 616
Single answerYour company runs an e-commerce application on a fleet of EC2 instances behind an Application Load Balancer (ALB). The application stores session data locally on each EC2 instance. Due to increasing traffic, the current architecture is experiencing scalability issues, and customer sessions are being lost when instances are replaced during scaling events. The company wants to ensure a seamless user experience, maintain session consistency across scaling events, and reduce operational overhead. As an AWS Certified Solutions Architect, what is the most suitable new architecture for this workload?
- A
Use an Amazon ElastiCache cluster to store session data and modify the application to retrieve session data from ElastiCache.
- B
Migrate the application to Amazon Elastic Kubernetes Service (EKS) and configure persistent storage for session data.
- C
Enable sticky sessions on the Application Load Balancer to maintain session consistency across scaling events.
- D
Use Amazon S3 to store session data and configure the application to retrieve it from S3.
Show answer and explanation
Correct answer: A
Explanation
The best solution to this problem is to externalize session storage using a scalable and low-latency service like Amazon ElastiCache. This approach decouples session data from EC2 instances, ensuring that sessions persist across scaling events and minimizing operational complexity. Other options either fail to address the scalability issue effectively or introduce unnecessary complexity.
- A. Correct.
This is the correct answer. Using Amazon ElastiCache to store session data decouples session storage from the EC2 instances, allowing the application to scale horizontally without session loss. ElastiCache provides low-latency, in-memory data storage, which is well-suited for session data.
- B. Incorrect.
While EKS can provide container orchestration, it does not inherently solve the issue of session persistence during scaling events unless combined with a specific storage solution. This would also add unnecessary complexity compared to using ElastiCache.
- C. Incorrect.
Enabling sticky sessions could temporarily solve the issue, but it tightly couples sessions to specific EC2 instances, limiting scalability and fault tolerance. It is not a long-term, scalable solution.
- D. Incorrect.
Amazon S3 is not designed for low-latency, high-frequency data retrieval like session storage. Using S3 for session data would result in poor performance and is not a recommended approach.