A developer is designing a high-traffic web application hosted on Amazon ECS. The application requires a caching layer to store session state data for logged-in users. The session states must be replicated across multiple Availability Zones to ensure high availability, and the cache must support automatic failover. Additionally, the configuration credentials for the cache cluster must be retrieved securely from a service that supports automatic credential rotation. Which architecture should the developer implement to meet these requirements?
- Configure Amazon ElastiCache for Redis with replication enabled. Store the cache access credentials in AWS Secrets Manager and configure automatic rotation for the credentials.Answer
- BConfigure Amazon ElastiCache for Redis with replication enabled. Store the cache access credentials in AWS Systems Manager Parameter Store and configure automatic rotation for the credentials.
- CStore session state data in Amazon DynamoDB. Implement an AWS Lambda function that runs a periodic Scan operation on the table to identify and delete expired session records.
- DStore session state data in Amazon DynamoDB. Set the partition key of the table to a constant string value 'ActiveSession' for all users, and increase the provisioned read capacity units (RCUs) to prevent throttling errors.
Answer
Configure Amazon ElastiCache for Redis with replication enabled. Store the cache access credentials in AWS Secrets Manager and configure automatic rotation for the credentials.
The correct solution uses Amazon ElastiCache for Redis with replication enabled, which provides multi-AZ replication, high availability, and automatic failover. The credentials are stored in AWS Secrets Manager, which natively supports automatic rotation of secrets. This directly satisfies all the requirements.
Step-by-Step Solution
Key Concept
Selecting and configuring the appropriate caching and state management services in AWS based on high availability, performance, and security requirements.