Question

Difficulty: MediumApplication Caching and Session State Management

A developer is designing a web application that will be deployed across multiple Amazon EC2 instances in an Auto Scaling group. The application requires a shared session state store that is highly available, survives instance terminations, and survives scale-out events. The session data must be retrieved with sub-millisecond or single-digit millisecond latency, and expired sessions must be automatically deleted to prevent unlimited storage growth. Which TWO solutions meet these requirements? (Select TWO.)

  1. Store session data in Amazon DynamoDB and enable Time to Live (TTL) on a designated epoch timestamp attribute.Answer
  2. Store session data in Amazon ElastiCache for Redis with replication enabled and configure key expiration.Answer
  3. C
    Store session data in Amazon Systems Manager Parameter Store and delete expired sessions using a scheduled AWS Lambda function.
  4. D
    Store session data in Amazon DynamoDB and execute a daily AWS Lambda function that performs a Scan operation to delete expired items.
  5. E
    Store session data in AWS Secrets Manager and configure automatic rotation of session records using a custom AWS Lambda function.

Answer

Storing session data in Amazon DynamoDB with Time to Live (TTL) enabled, and storing session data in Amazon ElastiCache for Redis with replication and key expiration configured.
The correct solutions are storing session data in Amazon DynamoDB with Time to Live (TTL) enabled, and storing session data in Amazon ElastiCache for Redis with replication and key expiration. DynamoDB provides single-digit millisecond latency and scales automatically, while its TTL feature handles deletion of expired sessions without consuming write capacity. ElastiCache for Redis is an in-memory data store that offers sub-millisecond performance, and using a replicated cluster ensures high availability while natively supporting key expiration.

Step-by-Step Solution

1
Identify the latency and availability requirements of the session store.
The session store must survive instance terminations (shared and external), be highly available, and provide sub-millisecond or single-digit millisecond latency.
This filters out storage systems with high latency (like S3 or Glacier) and non-shared stores (like local EC2 instance memory).
2
Evaluate suitable AWS database and caching services that support automated cleanup.
Amazon DynamoDB supports low-latency document/key-value storage with native Time to Live (TTL) to automatically delete expired items. Amazon ElastiCache for Redis provides in-memory sub-millisecond retrieval and supports native key TTL expiration.
Using native TTL features removes the overhead of manual scans or custom cleanup logic, minimizing resource consumption and costs.

Key Concept

Session State Management and Caching on AWS
Estimated Time:2m 0s
Rate this question