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?
- Migrate the session storage to an Amazon ElastiCache for Redis cluster with Multi-AZ enabled.Cevap
- Implement a write-through caching strategy in the application, updating the cache whenever session data is modified.Cevap
- CLeverage Amazon DynamoDB Accelerator (DAX) to cache session data and use Scan operations with filter expressions to retrieve active user sessions.
- DStore active session state payloads as secure strings in AWS Systems Manager Parameter Store and enable Parameter Store caching.
- EPublish session state updates to an Amazon SQS queue and use the visibility timeout to manage concurrent session access.
Cevap
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.
Adım Adım Çözüm
Anahtar Kavram
Session state management and cache consistency strategies using Amazon ElastiCache