AWSDesign Resilient Architectures

Auto Scaling & ELB — SAA-C03 Practice Question

A representative AWS Solutions Architect Associate (SAA-C03) exam question on Auto Scaling & ELB. Work through it below, then read why each option is right or wrong.

Short answer

The correct answer is A. Enable ALB sticky sessions (session affinity) using application-based cookies with a duration that matches the session timeout.

ALB sticky sessions route a user's requests to the same target instance for the duration of the session, preventing session loss during normal operation. Application-based cookies give fine-grained control. While this does not fully solve the scale-in problem (sessions on terminated instances are still lost), the question asks for LEAST application changes. Sticky sessions require zero code changes — only ALB configuration.

The Question

A company runs a stateful web application on Amazon EC2 instances behind an Application Load Balancer (ALB). The application stores user session data in memory on each EC2 instance. Users report that they lose their shopping cart data when the Auto Scaling group scales in and terminates instances. The solutions architect needs to fix this issue while minimizing changes to the application code. Which solution addresses the session persistence problem with the LEAST application changes?

AEnable ALB sticky sessions (session affinity) using application-based cookies with a duration that matches the session timeoutCorrect
BStore session data in Amazon ElastiCache for Redis and configure the application to read/write sessions from ElastiCache
CEnable ALB sticky sessions using duration-based cookies and configure the Auto Scaling group to use a scale-in protection policy
DStore session data in Amazon DynamoDB with TTL enabled and modify the application to use DynamoDB for session management

Why A is correct

ALB sticky sessions route a user's requests to the same target instance for the duration of the session, preventing session loss during normal operation. Application-based cookies give fine-grained control. While this does not fully solve the scale-in problem (sessions on terminated instances are still lost), the question asks for LEAST application changes. Sticky sessions require zero code changes — only ALB configuration.

Why the other options are wrong

Option B: Store session data in Amazon ElastiCache for Redis and configure the application to read/write sessions from ElastiCache

While ElastiCache for Redis is the best long-term architectural solution for session management, it requires significant application code changes to externalize session storage. The question specifically asks for the LEAST application changes.

Option C: Enable ALB sticky sessions using duration-based cookies and configure the Auto Scaling group to use a scale-in protection policy

Scale-in protection prevents instances from being terminated, but this defeats the purpose of Auto Scaling and can lead to over-provisioning. Duration-based sticky sessions also have the same limitation that sessions are lost when instances are terminated for other reasons (unhealthy checks, AZ rebalancing).

Option D: Store session data in Amazon DynamoDB with TTL enabled and modify the application to use DynamoDB for session management

Like ElastiCache, DynamoDB session storage requires application code changes to externalize sessions. While DynamoDB with TTL is a viable session store, it does not meet the "least application changes" requirement.

Key idea: Auto Scaling & ELB

Why A is correct: ALB sticky sessions route a user's requests to the same target instance for the duration of the session, preventing session loss during normal operation. Application-based cookies give fine-grained control. While this does not fully solve the scale-in problem (sessions on terminated instances are still lost), the question asks for LEAST application changes. Sticky sessions require zero code changes — only ALB configuration. Why B is wrong: While ElastiCache for Redis is the best long-term architectural solution for session management, it requires significant application code changes to externalize session storage. The question specifically asks for the LEAST application changes. Why C is wrong: Scale-in protection prevents instances from being terminated, but this defeats the purpose of Auto Scaling and can lead to over-provisioning. Duration-based sticky sessions also have the same limitation that sessions are lost when instances are terminated for other reasons (unhealthy checks, AZ rebalancing). Why D is wrong: Like ElastiCache, DynamoDB session storage requires application code changes to externalize sessions. While DynamoDB with TTL is a viable session store, it does not meet the "least application changes" requirement. On the SAA-C03 exam, questions in the "Design Resilient Architectures" domain test whether you can map a scenario's constraints to the right choice. Read the requirement carefully, eliminate options that violate any single constraint, and pick the one that satisfies all of them with the least operational overhead.

Ready to see how you'd score?

Take the free practice quiz and find out which AWS Solutions Architect Associate domains you need to focus on. No signup required.

Practice 5 similar questions

Same cert, same or adjacent domain. Use these after reviewing the explanation.

Related AWS Solutions Architect Associate Practice Questions