A developer is designing a web application hosted on AWS Lambda that connects to an Amazon RDS PostgreSQL database. The application must store transient user session data that expires after 24 hours, and it must also cache frequent, read-heavy queries from the RDS database to reduce latency and database load.
Which two options should the developer choose to meet these requirements? (Select TWO.)
- Store user session data in Amazon DynamoDB with a partition key of UserId and enable Time to Live (TTL) to automatically delete expired sessions.Cevap
- Implement Amazon ElastiCache for Redis to cache database query results from the Amazon RDS instance using a lazy-loading strategy.Cevap
- CStore the transient user session state in AWS Systems Manager Parameter Store as SecureString parameters to allow global sharing across all sessions.
- DRetrieve user session data from Amazon DynamoDB using the Scan operation with a filter expression on UserId to avoid configuring a primary partition key.
- ECache session data within the AWS Lambda function's global execution context memory to guarantee session persistence across all concurrent users.
Cevap
Store user session data in Amazon DynamoDB with a partition key of UserId and enable Time to Live (TTL), and implement Amazon ElastiCache for Redis to cache database query results from the Amazon RDS instance using a lazy-loading strategy.
The correct combination is storing session data in Amazon DynamoDB with a partition key of UserId and enabling Time to Live (TTL), and implementing Amazon ElastiCache for Redis to cache database query results using a lazy-loading strategy. Storing session state in Amazon DynamoDB is a standard, highly scalable architecture pattern. Since the sessions expire in 24 hours, DynamoDB TTL automatically deletes expired items at no cost, saving write capacity. For the relational database queries, Amazon ElastiCache for Redis acts as a high-performance caching layer that drastically reduces load on the Amazon RDS instance.
Adım Adım Çözüm
Anahtar Kavram
Caching database query results with ElastiCache and managing transient session states with DynamoDB TTL.
Alternatif Yöntem
Instead of ElastiCache for Redis, self-hosting Redis on Amazon EC2 could be used, but this adds administrative overhead and does not align with AWS managed database/caching best practices.
Tahmini Süre:2m 0s