Question

Difficulty: MediumApplication Caching and Session State Management

A developer is designing a web application deployed on Amazon ECS. The application requires an external session state store to manage user shopping carts. The session data must be retrieved with sub-millisecond response times, support nested JSON structures, and remain highly available even in the event of an infrastructure failure. Which architecture should the developer implement to meet these requirements?

  1. A
    Store the session data in an Amazon DynamoDB table and retrieve the shopping cart items using Scan operations with a filter expression on the user session ID.
  2. B
    Save the shopping cart details as configuration parameters in AWS Systems Manager Parameter Store, updating them using the parameter history.
  3. Deploy an Amazon ElastiCache for Redis cluster with Multi-AZ replication enabled to store the session data.Answer
  4. D
    Store the session data in an Amazon DynamoDB table with a partition key based on the user's country code, and use DynamoDB Accelerator (DAX) to cache all updates.

Answer

Deploying an Amazon ElastiCache for Redis cluster with Multi-AZ replication enabled to store the session data.
Deploying an Amazon ElastiCache for Redis cluster with Multi-AZ replication meets all requirements. Redis is an in-memory data store that achieves sub-millisecond latencies and natively supports complex data types (such as hashes, lists, and sets) which are ideal for nested JSON shopping cart data. Enabling Multi-AZ replication ensures automatic failover and high availability if the primary node encounters issues.

Step-by-Step Solution

1
Analyze the requirements for the session store: sub-millisecond retrieval latency, support for nested JSON structures, high availability during failures, and dynamic scaling.
The requirements point to an in-memory caching or NoSQL database solution that supports replication, failover, and complex data formats.
Establishing the functional and non-functional requirements filters out unsuitable AWS services.
2
Evaluate Amazon ElastiCache for Redis against the requirements.
ElastiCache for Redis provides sub-millisecond response times, supports complex data structures (like hashes and lists for nested JSON), and offers Multi-AZ replication for auto-failover.
Redis is designed specifically for fast in-memory key-value caching with persistence and high availability.
3
Compare against alternatives such as DynamoDB with DAX, SSM Parameter Store, and DynamoDB with Scan operations.
DynamoDB Scan operations are too slow and expensive. Systems Manager Parameter Store is not designed for fast transactional session states. Using a low-entropy partition key (like country code) in DynamoDB will create hot partition issues that DAX cannot resolve on writes.
Ruling out distractors validates that the chosen solution is the most architecturally sound option.

Key Concept

Selecting the appropriate in-memory caching engine (ElastiCache for Redis vs Memcached) and avoiding database bottlenecks for session state storage.
Estimated Time:1m 30s
Rate this question