CertKeen

AWS Solutions Architect Professional (SAP-C03) · Free practice question 2 of 12

Externalizing session state for elastic web tiers

Copperfield Tours keeps user shopping sessions in the memory of each EC2 web server, so the load balancer uses sticky sessions. When Auto Scaling removes an instance, customers on it lose their carts. The company wants instances to be freely replaceable and wants to remove stickiness. What should the architect change?

  1. A.Write session data to the instance store volume of each web server so it survives scale-in
  2. B.Turn off scale-in for the Auto Scaling group so that instances are never removed during the day
  3. C.Increase the ALB stickiness duration to seven days so that customers stay on one instance
  4. D.Store session data in an ElastiCache for Valkey cluster that every web server reads and writes
Show answer and explanation

Correct answer: D. Store session data in an ElastiCache for Valkey cluster that every web server reads and writes

Why: Moving session state to a shared external store such as ElastiCache makes the web tier stateless, so any instance can serve any request and instances can be added or terminated without losing carts. Longer stickiness still loses sessions when an instance is removed. Disabling scale-in wastes money and does not handle instance failures. Instance store data is lost when the instance terminates.

More free AWS Solutions Architect Professional (SAP-C03) questions