A company runs a stateful web application on EC2 instances behind an Application Load Balancer. The application stores session data locally on the instances. The company wants to improve availability and scalability. What should a solutions architect recommend?
ElastiCache (Redis or Memcached) externalises session state so any instance behind the ALB can serve any user request. This removes instance affinity, letting the architect scale horizontally and survive instance loss without dropping sessions, satisfying the availability and scalability goals.
Why this answer
Moving session state to Amazon ElastiCache makes the application stateless, allowing EC2 instances to be added or removed without session loss, which improves both availability and scalability. Option B (Auto Scaling alone) is wrong because without external session storage, scaling out will cause new instances to lack existing session data, and terminating instances will lose sessions. Option C (sticky sessions) is wrong because it only routes a user to the same instance, but if that instance fails, the session is lost.
Option D (larger instances) is wrong because it does not address scalability; it only increases capacity of individual instances, but does not allow for horizontal scaling or improve availability beyond a single instance.