Courseiva
Design for New SolutionsmediumMultiple ChoiceObjective-mapped

SAP-C02 Design for New Solutions Practice Question

A company is running a stateful web application on Amazon EC2 instances behind an Application Load Balancer (ALB). The application stores session data locally on the instance. The company wants to make the application highly available and fault-tolerant without rewriting the application code. What should the solutions architect do?

⚠ Common exam trap

Test-takers frequently assume moving session state to an external store like ElastiCache is the only way to achieve fault tolerance, but the question explicitly prohibits rewriting application code, making sticky sessions the correct choice despite its limitations (e.g., uneven load distribution).

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

Configure the ALB with sticky sessions (session affinity) and use a custom cookie.

Configuring the ALB with sticky sessions (session affinity) using a custom cookie allows the ALB to consistently route requests from a user's session to the same EC2 instance, preserving the locally stored session state without requiring any application code changes. This approach leverages the ALB's built-in session affinity feature, which is transparent to the application and ensures high availability by distributing traffic across healthy instances while maintaining session continuity.

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 ALB with a Network Load Balancer (NLB) and enable cross-zone load balancing.

    Why it's wrong here

    NLB does not natively support sticky sessions; also state is still local.

  • Move session state to Amazon ElastiCache and configure the ALB to use sticky sessions.

    Why it's wrong here

    Moving session state to ElastiCache requires code modification.

  • Configure the ALB with sticky sessions (session affinity) and use a custom cookie.

    Why this is correct

    Sticky sessions bind a user to a specific instance, preserving local state without code changes.

  • Use an Auto Scaling group to add more instances and distribute load.

    Why it's wrong here

    Auto Scaling does not solve the session state problem; new instances won't have the session.

About these practice questions

One of 1,660 original SAP-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 →

How Courseiva writes practice questions · Editorial policy

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.