Question

Difficulty: HardApplication Caching and Session State Management

An application deployed on AWS App Runner must retrieve and update user session data. Currently, the session data is stored in an Amazon DynamoDB table, but the application is suffering from high latency and scaling costs during peak traffic. The development team wants to optimize session state management to achieve sub-millisecond response times for read operations and reduce DynamoDB read throughput costs. The session data is updated frequently, and stale session states are unacceptable. Which two actions should the developer take to meet these requirements?

  1. Migrate the session storage to an Amazon ElastiCache for Redis cluster with Multi-AZ enabled.Answer
  2. Implement a write-through caching strategy in the application, updating the cache whenever session data is modified.Answer
  3. C
    Leverage Amazon DynamoDB Accelerator (DAX) to cache session data and use Scan operations with filter expressions to retrieve active user sessions.
  4. D
    Store active session state payloads as secure strings in AWS Systems Manager Parameter Store and enable Parameter Store caching.
  5. E
    Publish session state updates to an Amazon SQS queue and use the visibility timeout to manage concurrent session access.

Answer

Migrating the session storage to Amazon ElastiCache for Redis and implementing a write-through caching strategy.
Migrating session storage to Amazon ElastiCache for Redis provides sub-millisecond latency for session state management. A write-through caching strategy ensures that the cache is updated synchronously when session data changes, preventing stale session reads in a highly dynamic environment.

Step-by-Step Solution

1
Analyze application requirements
Identified the need for sub-millisecond read latency, high-frequency updates, prevention of stale session reads, and reduction of DynamoDB costs.
Establishes the performance and consistency boundaries for the architectural selection.
2
Select the optimal cache storage engine
Selected Amazon ElastiCache for Redis with Multi-AZ enablement.
Redis provides the low-latency key-value data structures required for session state, while Multi-AZ ensures failover capability.
3
Select the caching strategy for real-time consistency
Selected a write-through caching pattern.
Write-through caching updates both the cache and backend database simultaneously when session writes occur, ensuring subsequent reads from the cache never return stale data.

Key Concept

Session state management and cache consistency strategies using Amazon ElastiCache
Rate this question