A web app stores user session data in memory on each EC2 instance. When Auto Scaling terminates an instance, users get logged out. How should sessions be handled so any instance can serve any user?
A) Disable Auto Scaling so instances never terminate.
B) Store session state in an external store such as Amazon ElastiCache or DynamoDB.
C) Use sticky sessions and hope instances don’t fail.
D) Increase each instance’s memory.
Correct Answer: B
Explanation: Externalizing session state to ElastiCache or DynamoDB makes the web tier stateless, so any instance can handle any request and scaling/failures don’t log users out. (A) defeats elasticity. (C) sticky sessions still drop sessions on instance loss. (D) doesn’t address the root cause.