SOA-C02 Reliability and Business Continuity Practice Question
A company runs a stateful web application on EC2 instances in an Auto Scaling group across two Availability Zones. The application uses an Application Load Balancer for traffic distribution. Users report that their sessions are frequently lost during scale-in events. The SysOps administrator needs to minimize session loss without introducing significant latency. What should the administrator do?
⚠ Common exam trap
It's easy for candidates to assume increasing timeouts (cooldown or deregistration delay) alone is sufficient, but without a lifecycle hook to coordinate the Auto Scaling group with the ALB's draining process, instances can be terminated prematurely, causing session loss.
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 (session affinity) on the ALB. Configure a lifecycle hook on the Auto Scaling group with a wait time equal to the ALB's connection draining timeout.
Enabling sticky sessions (session affinity) on the ALB ensures that a client's requests are consistently routed to the same EC2 instance, preventing session loss during scale-in. Configuring a lifecycle hook on the Auto Scaling group with a wait time equal to the ALB's connection draining timeout (deregistration delay) allows in-flight requests to complete before the instance is terminated, minimizing session disruption without adding significant latency.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Replace the Application Load Balancer with a Network Load Balancer. Enable proxy protocol v2 to pass client IP addresses.
Why it's wrong here
Replacing the Application Load Balancer with a Network Load Balancer would shift traffic handling from Layer 7 to Layer 4. While proxy protocol v2 correctly preserves the client IP address, the NLB cannot inspect or set HTTP cookies, so it does not support cookie-based sticky sessions. As a result, requests from the same user would be distributed across multiple instances, breaking session persistence and potentially losing in-flight state.
- ✓
Enable sticky sessions (session affinity) on the ALB. Configure a lifecycle hook on the Auto Scaling group with a wait time equal to the ALB's connection draining timeout.
Why this is correct
Enabling sticky sessions on the ALB uses the AWSALB cookie to pin a client's requests to the same target instance, preserving session state across the fleet. A lifecycle hook on the Auto Scaling group pauses the termination process during scale-in, and setting its wait time to match the ALB's connection draining timeout (deregistration delay) allows in-flight requests to finish before the instance is removed. This coordinated approach ensures that a terminating instance drains gracefully while session continuity is maintained.
- ✗
Increase the Auto Scaling group's cooldown period to 600 seconds. Configure the ALB to have a deregistration delay of 600 seconds.
Why it's wrong here
Increasing the Auto Scaling group's cooldown period to 600 seconds only suppresses new scaling actions after a scaling activity; it does not influence how the ALB routes individual requests. The deregistration delay of 600 seconds merely extends the time a terminating instance remains in the target group, but without session affinity the ALB may still send requests from the same session to other instances during that window. This combination delays termination but does not guarantee that a user's session stays on the same instance, so it fails to solve the core problem.
- ✗
Configure the Auto Scaling group to scale based on memory utilization instead of CPU. Set the cooldown period to 300 seconds.
Why it's wrong here
Switching the scaling metric to memory utilization, even if implemented with a custom CloudWatch metric, changes only the conditions that trigger scaling, not how requests are distributed among instances. The cooldown period postpones subsequent scaling activities but does nothing to prevent the Auto Scaling group from terminating instances that are actively serving sessions during scale-in. Without sticky sessions and a lifecycle hook, session state is still lost when an instance is replaced, regardless of which metric drives the scaling decision.
Go deeper
Related to this question
About these practice questions
One of 1,169 original SOA-C02 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
Same concept, more angles
2 more ways this is tested on SOA-C02
These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.
Variation 1. A company runs a stateful web application on EC2 instances in an Auto Scaling group behind an Application Load Balancer. Users report that their sessions are frequently lost during scaling events. What is the MOST effective solution to maintain session persistence?
hard- A.Increase the cooldown period for the Auto Scaling group.
- ✓ B.Modify the application to store session data in an external data store such as ElastiCache or DynamoDB.
- C.Enable sticky sessions (session affinity) on the Application Load Balancer.
- D.Use larger EC2 instance types to reduce the frequency of scaling.
Why B: Externalizing session state to a durable, shared data store like ElastiCache or DynamoDB decouples session data from individual EC2 instances. This ensures that sessions survive scaling events, including instance termination during scale-in, because any instance can retrieve the session from the external store. Sticky sessions (option C) only route traffic to the same instance, but they do not preserve session data if that instance is terminated. Options A and D do not address session persistence at all.
Variation 2. A company runs a stateful web application on EC2 instances in an Auto Scaling group. The application uses a sticky session (session affinity) feature of the Application Load Balancer. During a scale-in event, some users lose their session data. What should the SysOps administrator do to prevent session data loss?
hard- A.Disable sticky sessions and use a round-robin routing algorithm.
- ✓ B.Store session state in an external data store such as Amazon ElastiCache.
- C.Use a lifecycle hook to back up session data before termination.
- D.Increase the Auto Scaling group's cooldown period to delay termination.
Why B: Sticky sessions (session affinity) tie a user's session to a specific EC2 instance. When a scale-in event terminates that instance, the session data stored locally on the instance is lost. Storing session state in an external data store like Amazon ElastiCache decouples session data from individual instances, allowing any healthy instance to serve the user's request without data loss, even after a scale-in event.
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.