SOA-C02 Networking and Content Delivery Practice Question
A company is deploying a web application on EC2 instances behind an Application Load Balancer (ALB). The application needs to maintain user session state. Which configuration ensures session stickiness with minimal performance impact?
⚠ Common exam trap
Many candidates confuse session stickiness with session persistence via external storage (DynamoDB) or assume a Network Load Balancer can provide cookie-based stickiness, but the exam tests the specific AWS service capabilities: only ALB supports cookie-based sticky sessions at Layer 7 with minimal performance impact.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Enable sticky sessions on the Application Load Balancer using a load balancer-generated cookie.
Enabling sticky sessions on an Application Load Balancer (ALB) using a load balancer-generated cookie (AWSALB) binds a user's session to a specific target instance with minimal overhead. The ALB inserts the cookie in the response, and subsequent requests from the same client are routed to the same instance without requiring application-level session replication or external storage, thus preserving performance.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Use Amazon CloudFront with origin stickiness enabled.
Why it's wrong here
Amazon CloudFront is a content delivery network that caches content at edge locations, but it does not provide layer-7 session affinity or any native 'origin stickiness' feature to bind a user to a specific EC2 instance. While CloudFront can forward cookies to the origin for cache decisions, it does not guarantee that all requests from a client are routed to the same instance, so session state would be lost when requests hit different origins. Therefore this option does not satisfy the requirement of maintaining session continuity.
- ✗
Use a Network Load Balancer (NLB) with target group stickiness.
Why it's wrong here
A Network Load Balancer operates at the transport layer (L4) and does not inspect HTTP cookies, so its target group 'stickiness' is implemented as source IP hash-based routing rather than application-layer session affinity. Because clients often traverse NAT gateways, proxies, or mobile networks, their source IP can change mid-session, causing the NLB to route requests to a different EC2 instance and drop the session. Additionally, an NLB cannot generate a load balancer cookie (like ALB's AWSALB) for cookie-based stickiness, making it unsuitable for this stateful web application scenario.
- ✓
Enable sticky sessions on the Application Load Balancer using a load balancer-generated cookie.
Why this is correct
The Application Load Balancer supports sticky sessions by generating a durable cookie (AWSALB) that is stored in the client's browser and mapped to the specific EC2 instance that handled the initial request. On subsequent requests, the ALB reads this cookie and routes the client to the same instance for the duration of the cookie's lifetime or until the instance becomes unhealthy. This mechanism is purpose-built for session-stateful web applications, and it adds negligible overhead because the routing decision is made entirely on the ALB without requiring external database reads or application code changes.
- ✗
Store session state in Amazon DynamoDB and have each instance read from DynamoDB.
Why it's wrong here
Storing session state in DynamoDB introduces network latency for every request as each instance performs a separate read operation against an external database, whereas the correct approach uses the ALB’s native cookie-based stickiness to route requests to the same instance without any external calls. This option is tempting because DynamoDB is a fully managed, highly available key-value store ideal for offloading session persistence in stateless architectures, and would be correct if the requirement were to decouple session data from compute for resilience across instance failures.
Quick reference
AWS S3 Storage Class Comparison
| Storage Class | Min Duration | Retrieval | Use Case |
|---|---|---|---|
| S3 Standard | None | Immediate | Frequently accessed data |
| S3 Standard-IA | 30 days | Immediate | Infrequent access, rapid retrieval |
| S3 One Zone-IA | 30 days | Immediate | Non-critical infrequent data |
| S3 Intelligent-Tiering | None | Immediate–hours | Unknown or changing access patterns |
| S3 Glacier Instant | 90 days | Milliseconds | Archive with instant retrieval |
| S3 Glacier Flexible | 90 days | Minutes–hours | Archive, flexible retrieval |
| S3 Glacier Deep Archive | 180 days | Hours | Long-term compliance archive |
Go deeper
Related to this question
About these practice questions
Courseiva writes every SOA-C02 question from scratch — 1,169 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This SOA-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the SOA-C02 exam.