AWS Certified Solutions Architect – Associate (SAA-C03)Design Resilient ArchitecturesEasy
A company is hosting a critical web application on AWS using an Application Load Balancer (ALB) in front of an Auto Scaling group of EC2 instances across multiple Availability Zones. They need to ensure that user sessions are maintained, meaning a user's subsequent requests are routed to the same EC2 instance that handled their initial request. Which ALB feature should be enabled?
- ATarget group weighting
- BSticky sessions
- CHealth checks
- DCross-zone load balancing
Show answer & explanationAnswer & explanation
Correct answer: B. Sticky sessions
Sticky sessions, also known as session affinity, ensure that requests from the same client are always routed to the same target (EC2 instance) behind a load balancer. This is essential for applications that store session-specific data locally on the instance.
Why the other options are wrong
- A. Target group weighting is used for traffic distribution based on predefined weights, not for session persistence.
- C. Health checks monitor the health of targets and remove unhealthy ones from rotation.
- D. Cross-zone load balancing distributes traffic evenly across all registered targets in all enabled AZs.
ALB Sticky Sessions
A feature of Application Load Balancers (and other ELBs) that binds a user's session to a specific target (e.g., EC2 instance). All requests from that user during the session are sent to the same target.
- Crucial for applications that store session state on the server.
- Implemented using cookies.
- Can be time-based or application-based.
- May reduce fault tolerance if a sticky target fails, as sessions might be lost.
Memory trick: ALB's Stickiness: Keeps You With Your Server.