SAP-C02 Continuous Improvement for Existing Solutions Practice Question
An e-commerce company runs a customer-facing application on AWS. The application architecture includes an Application Load Balancer (ALB), EC2 instances in an Auto Scaling group, and an Amazon RDS for MySQL Multi-AZ DB instance. The application uses a custom web server that stores session data in a local file system. During peak traffic, users experience session timeouts and errors. The operations team observes that the Auto Scaling group launches new instances and terminates old ones frequently. The team wants to improve the user experience and ensure session persistence. The Solutions Architect proposes to modify the application to store session data in an external store. However, due to a legacy code dependency, the application cannot be modified in the short term. Which solution should the Solutions Architect implement to resolve the session persistence issue without modifying the application?
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 and configure the Auto Scaling group to use a lifecycle hook to drain connections before instance termination.
Enabling sticky sessions on the ALB ensures that a user's requests are always routed to the same instance, preserving the local session files. Additionally, configuring a lifecycle hook to drain connections before instance termination prevents session loss during scale-in events. Option A is incorrect because ElastiCache requires application code changes to use it. Option C is incorrect because DynamoDB also requires code changes. Option D is incorrect because scaling down based on memory does not prevent session loss; it may cause more terminations.
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 local file system storage with an Amazon ElastiCache for Redis cluster that is external to the instances.
Why it's wrong here
Requires application code changes to use Redis.
- ✓
Enable sticky sessions (session affinity) on the ALB and configure the Auto Scaling group to use a lifecycle hook to drain connections before instance termination.
Why this is correct
Sticky sessions route user to same instance; lifecycle hook ensures sessions complete before termination.
- ✗
Store session data in Amazon DynamoDB and configure the application to use the DynamoDB session handler.
Why it's wrong here
Requires code changes.
- ✗
Configure the Auto Scaling group to scale down based on memory utilization rather than CPU, to reduce termination frequency.
Why it's wrong here
Does not solve session persistence; still loses sessions when instance terminates.
Visual reference
Go deeper
Related to this question
About these practice questions
Courseiva writes every SAP-C02 question from scratch — 1,660 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 SAP-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 SAP-C02 exam.