Courseiva

SAP-C02 Practice Question: Accelerate Workload Migration and Modernization

A company is migrating a stateful web application to AWS. The application uses local storage for user sessions. Which AWS service can help make the application stateless and scalable?

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

✓

Amazon ElastiCache

Amazon ElastiCache provides a managed in-memory cache that can store session data externally, allowing the web application to be stateless and scale horizontally. Amazon EBS volumes are attached to a single EC2 instance and cannot be shared across instances, so they do not help with statelessness. Amazon RDS is for relational databases and is not optimized for low-latency session state. Amazon S3 is an object store with higher latency and is not suitable for frequent session reads/writes.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    Amazon EBS

    Why it's wrong here

    Amazon EBS volumes attach to a single EC2 instance in one Availability Zone, so sessions remain tied to that instance and cannot be shared across a scaled fleet. EBS is tempting as block storage for a single server's data, and would be correct for a database's persistent disk.

  • ✓

    Amazon ElastiCache

    Why this is correct

    Amazon ElastiCache provides a shared, low-latency external store that offloads session state from instance-local storage. This directly addresses the stem's constraint of local storage for user sessions, letting instances be replaced freely and scaled horizontally behind a load balancer.

  • ✗

    Amazon RDS

    Why it's wrong here

    Amazon RDS is a managed relational database, not a session store; using it for per-request session reads adds latency and connection overhead without native key-value expiry. It is tempting as shared persistent storage, and would be correct for structured transactional data such as orders or user records.

  • ✗

    Amazon S3

    Why it's wrong here

    Amazon S3 provides object storage, not a low-latency shared session store with atomic read-modify-write semantics that a web tier needs. It is tempting as durable centralised storage, and would be correct for static assets or backups rather than live session state.

Quick reference

AWS S3 Storage Class Comparison

Storage ClassMin DurationRetrievalUse Case
S3 StandardNoneImmediateFrequently accessed data
S3 Standard-IA30 daysImmediateInfrequent access, rapid retrieval
S3 One Zone-IA30 daysImmediateNon-critical infrequent data
S3 Intelligent-TieringNoneImmediate–hoursUnknown or changing access patterns
S3 Glacier Instant90 daysMillisecondsArchive with instant retrieval
S3 Glacier Flexible90 daysMinutes–hoursArchive, flexible retrieval
S3 Glacier Deep Archive180 daysHoursLong-term compliance archive

About these practice questions

One of 984 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

Same concept, more angles

4 more ways this is tested on SAP-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 is migrating a stateful application to AWS. The application uses local storage for temporary data that must survive instance restarts but not region failures. Which storage solution should the company use?

medium
  • A.Amazon EBS
  • ✓ B.Instance Store
  • C.Amazon S3
  • D.Amazon EFS

Why B: Instance Store provides ephemeral block storage physically attached to the host, and its data survives instance reboots (restarts) but is lost on instance stop/terminate or host failure. That matches the requirement: data must survive restarts but not region failures, and it is local storage for temporary data.

Variation 2. A company is migrating a stateful application to AWS. The application maintains session state in memory on the application server. Which AWS service should be used to store session state for high availability?

easy
  • A.Amazon RDS
  • B.Amazon S3
  • ✓ C.Amazon ElastiCache
  • D.Amazon EBS

Why C: Amazon ElastiCache is an in-memory caching service that supports Redis or Memcached, making it ideal for storing session state with low latency and high availability. It provides sub-millisecond response times and can be configured with Multi-AZ and automatic failover to ensure session data persists even if a node fails. This is the standard AWS solution for externalizing session state in stateless application architectures.

Variation 3. A company is migrating a multi-tier web application to AWS. The application uses sticky sessions (session affinity). The company wants to use an Application Load Balancer (ALB). How should the architect configure the ALB to support sticky sessions?

medium
  • A.Configure the ALB listener to use a custom header for session affinity.
  • ✓ B.Enable stickiness on the target group and set a cookie expiration duration.
  • C.Use a Network Load Balancer (NLB) and enable proxy protocol.
  • D.Place an Amazon ElastiCache cluster in front of the ALB to store session data.

Why B: For an Application Load Balancer (ALB) to support sticky sessions, you enable stickiness at the target group level and configure a cookie expiration duration. ALB uses a load balancer-generated cookie (AWSALB) to track session affinity, and the duration determines how long the cookie remains valid. This is the standard, supported method for session affinity on ALB.

Variation 4. A company is migrating a stateful application to AWS. The application runs on a single on-premises server and uses local storage for persistent data. The company wants to achieve high availability and scalability. Which migration approach should the company use?

medium
  • A.Use multiple EC2 instances behind an Application Load Balancer with sticky sessions.
  • B.Lift and shift to a single Amazon EC2 instance with an EBS volume.
  • ✓ C.Refactor the application to store state in Amazon ElastiCache or Amazon DynamoDB.
  • D.Use an EC2 Auto Scaling group with lifecycle hooks to persist state to EBS snapshots.

Why C: The application is stateful and needs high availability and scalability. Refactoring to store state in managed services like Amazon ElastiCache or DynamoDB decouples state from compute, allowing compute to scale and be replaced without data loss. Option A is wrong: while an ALB with sticky sessions distributes traffic, it ties sessions to specific instances, making scaling and failover complex and not fully HA. Option B is wrong: a single EC2 instance is a single point of failure and cannot scale. Option D is wrong: EBS snapshots are for backup/disaster recovery, not real-time HA or state persistence during scaling. Only option C properly addresses state management for HA and scalability.

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.