A company is designing a serverless application using AWS Lambda for business logic and Amazon API Gateway for REST APIs. The application needs to store and retrieve user session data. Which service should they use for session state?
Trap 1: Amazon ElastiCache for Redis
Amazon ElastiCache for Redis provides sub-millisecond latency but is not serverless; it requires managing cache clusters, which conflicts with the serverless requirement. DynamoDB, with its serverless nature and TTL support, is a better fit.
Trap 2: Amazon RDS for MySQL
Amazon RDS for MySQL is a relational database with higher latency and is not serverless, making it unsuitable for session state in a serverless application.
Trap 3: Amazon S3
Amazon S3 is an object storage service with high latency for frequent read/write operations, not designed for session state.
- A
Amazon ElastiCache for Redis
Why wrong: Amazon ElastiCache for Redis provides sub-millisecond latency but is not serverless; it requires managing cache clusters, which conflicts with the serverless requirement. DynamoDB, with its serverless nature and TTL support, is a better fit.
- B
Amazon RDS for MySQL
Why wrong: Amazon RDS for MySQL is a relational database with higher latency and is not serverless, making it unsuitable for session state in a serverless application.
- C
Amazon DynamoDB
Amazon DynamoDB is a serverless, fully managed NoSQL database that supports key-value access patterns with TTL expiration, making it ideal for session state in serverless architectures.
- D
Amazon S3
Why wrong: Amazon S3 is an object storage service with high latency for frequent read/write operations, not designed for session state.