Soru

Zorluk: OrtaApplication Caching and Session State Management

An application hosted on Amazon EC2 instances behind an Application Load Balancer requires a distributed, highly available session state store. The store must support low-latency read and write operations, automatically delete expired sessions to manage storage growth, and replicate data across multiple Availability Zones to ensure high availability. Which TWO solutions should a developer implement to meet these requirements? (Select TWO.)

  1. Store session data in an Amazon DynamoDB table and enable Time to Live (TTL) on a session expiration attribute.Cevap
  2. Store session data in an Amazon ElastiCache for Redis replication group with Multi-AZ enabled and configure key expiration on session keys.Cevap
  3. C
    Store session data in Amazon Systems Manager Parameter Store parameters.
  4. D
    Store session data in an Amazon DynamoDB table and run a recurring AWS Lambda function that performs a Scan operation to find and delete expired sessions.
  5. E
    Store session data in an Amazon DynamoDB table using a partition key based on the user's country code to distribute the load.

Cevap

Storing session data in an Amazon DynamoDB table with TTL enabled, or storing session data in an Amazon ElastiCache for Redis replication group with Multi-AZ and key expiration.
The correct options are storing session data in Amazon DynamoDB with TTL enabled, and using Amazon ElastiCache for Redis with Multi-AZ and key expiration. DynamoDB natively replicates data across multiple Availability Zones, supports low-latency writes, and automatically deletes expired items based on a TTL attribute without consuming read/write capacity. Amazon ElastiCache for Redis supports high-availability replication across Availability Zones, sub-millisecond latency, and native key expiration.

Adım Adım Çözüm

1
Evaluate the architectural requirements of the session store, focusing on low-latency, multi-AZ high availability, and automatic data expiration.
Identified that the store must replicate data across AZs and clean up expired entries automatically.
This sets the criteria to filter database and caching services.
2
Assess the capabilities of Amazon DynamoDB for session storage.
DynamoDB natively replicates data across AZs, provides single-digit millisecond latency, and features automatic item deletion via Time to Live (TTL) without using RCUs/WCUs.
DynamoDB with TTL satisfies all criteria.
3
Assess the capabilities of Amazon ElastiCache for Redis for session storage.
ElastiCache for Redis replication groups support Multi-AZ replication, sub-millisecond latencies, and native key expiration commands.
ElastiCache for Redis with Multi-AZ and key expiration satisfies all criteria.

Anahtar Kavram

Implementing distributed session stores with automatic expiration using Amazon DynamoDB TTL and Amazon ElastiCache for Redis.
Bu soruyu puanla