Soru

Zorluk: OrtaApplication Caching and Session State Management

A developer is designing a serverless e-commerce application that must manage highly dynamic user shopping carts and preferences. The session data must be retrieved with low latency (<10 ms< 10\text{ ms}), must scale automatically to handle millions of concurrent users, and must be automatically deleted after 30 minutes30\text{ minutes} of user inactivity.

Which TWO strategies should the developer implement to meet these requirements? (Select TWO.)

  1. Store the session data in an Amazon DynamoDB table and enable Time to Live (TTL) on a timestamp attribute.Cevap
  2. Store the session data in an Amazon ElastiCache for Redis cluster and use the Redis EXPIRE command to set a TTL on the session keys.Cevap
  3. C
    Store the session data in the global execution context of the application's AWS Lambda functions to cache it in memory between invocations.
  4. D
    Store the session data in an Amazon DynamoDB table and retrieve active sessions using Scan operations filtered by session state.
  5. E
    Store the session data in AWS Systems Manager Parameter Store and configure AWS Secrets Manager to automatically rotate the sessions.

Cevap

Store the session data in an Amazon DynamoDB table with Time to Live (TTL) enabled, or store the session data in an Amazon ElastiCache for Redis cluster using the EXPIRE command to automatically expire keys.
Storing session data in Amazon DynamoDB with TTL and storing session data in Amazon ElastiCache for Redis using the EXPIRE command are correct because both offer the required low latency, high scalability, and support automatic expiration of data after a period of inactivity. DynamoDB TTL deletes items automatically based on a timestamp, and Redis EXPIRE deletes keys after a specified number of seconds.

Adım Adım Çözüm

1
Analyze the requirements for session storage.
The application requires low latency, automatic scaling to support high traffic, and auto-expiration after 30 minutes of inactivity.
To narrow down candidate AWS services that support key-value lookups, high throughput, and automatic TTL-based cleanup.
2
Evaluate DynamoDB with TTL.
DynamoDB scales automatically, offers low latency, and automatically deletes expired items when TTL is enabled on an attribute.
To confirm that DynamoDB TTL satisfies all design constraints.
3
Evaluate ElastiCache for Redis with EXPIRE.
Redis is an in-memory database providing sub-millisecond latency and supports setting key expirations natively via the EXPIRE command.
To confirm that ElastiCache for Redis satisfies all design constraints.

Anahtar Kavram

Implementing session state management with automatic TTL-based cleanup in highly scalable databases and in-memory caches.
Bu soruyu puanla