Resilient Cloud Solutions

A web application stores shopping-cart sessions in EC2 instance memory behind an Application Load Balancer. Scale-in causes users to lose their carts; which change BEST preserves sessions while allowing instances to scale independently?

Show the answer

Correct answerA. Store session data in Amazon ElastiCache for Valkey.

AWhy this is right: A shared session store separates session state from web instances so scale-in does not discard carts.

BWhy not this: Idle timeout controls inactive connections, not session-data durability across instance termination.

CWhy not this: Stickiness helps route requests to the same live target but does not preserve its memory after termination.

DWhy not this: Source-IP affinity influences routing but does not move session data out of terminated instances.

An external session store keeps cart data independent of individual web instances, allowing any instance to serve a session after scale-in. Load balancer stickiness directs requests to a target but cannot preserve that target's memory after termination.