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

Question #1608

A company operates a web application on Amazon EC2 instances within an Auto Scaling group behind an Application Load Balancer configured with sticky sessions. The current setup stores user session state locally on each web server. To achieve high availability and prevent session data loss during server failures, which approach should be adopted?

A

Use an Amazon ElastiCache for Memcached cluster in single-node mode. Update the application to use ElastiCache for Memcached to store the session state.

B

Use Amazon ElastiCache for Redis with cluster mode enabled and Multi-AZ replication. Update the application to use ElastiCache for Redis to store the session state.

C

Use AWS Storage Gateway file gateway to store session data. Update the application to use AWS Storage Gateway to store the session state.

D

Use Amazon RDS with Multi-AZ deployment to store the session state. Update the application to use Amazon RDS to store the session state.

Explanation

Answer B is correct because:
- ElastiCache Redis with Multi-AZ and cluster mode provides high availability through automatic replication across Availability Zones (AZs) and failover capabilities, ensuring session data is preserved during server failures.
- In-memory storage offers low-latency access, critical for session management.
- Cluster mode enables horizontal scaling and data partitioning, improving performance and resilience.

Other options are incorrect because:
- A: Memcached in single-node mode lacks replication, risking data loss if the node fails.
- C: Storage Gateway introduces latency and is designed for file storage, not transient session data.
- D: RDS Multi-AZ, while highly available, is less efficient for session data due to higher latency and relational database overhead.

Key Takeaway: For session state requiring high availability and low latency, ElastiCache Redis (with Multi-AZ and cluster mode) is the optimal solution.

Answer

The correct answer is: B