A gaming company is launching a multiplayer online game that stores player state updates in an Amazon DynamoDB table. The application performs up to write operations per second during peak hours. The partition key is currently designed as `GameSessionDate` (formatted as `YYYY-MM-DD`) and the sort key is `PlayerID`. During load testing, the database experiences write throttling even though the provisioned write capacity units (WCUs) are scaled far beyond the requirements. Additionally, the application requires sub-millisecond latency for game session read queries. Which database architecture modification should the solutions architect implement to resolve the performance bottleneck and meet the latency requirements?
- AModify the partition key to use a monotonically increasing timestamp to ensure chronological order, and configure Amazon ElastiCache for Memcached to cache read queries.
- BMigrate the player state to Amazon RDS for PostgreSQL with Read Replicas, configuring the application to failover write operations to the Read Replicas during high-throughput events.
- Redesign the table schema to append a randomized shard suffix to the `GameSessionDate` partition key, and deploy an Amazon DynamoDB Accelerator (DAX) cluster to cache read requests.Answer
- DRetain the current key schema but switch the DynamoDB capacity mode to Provisioned Mode, configuring the sort key `PlayerID` with a monotonically increasing sequence number to distribute writes across partitions.
Answer
Redesign the table schema to append a randomized shard suffix to the `GameSessionDate` partition key, and deploy an Amazon DynamoDB Accelerator (DAX) cluster to cache read requests.
The correct answer resolves the write throttling issue by implementing write sharding on the partition key. Appending a randomized suffix to the date partition key distributes the write operations per second across multiple physical partitions. Additionally, deploying DynamoDB Accelerator (DAX) satisfies the requirement for sub-millisecond read latency by providing an in-memory cache directly integrated with the database.
Step-by-Step Solution
Key Concept
Partition key design, write sharding, and write/read performance scaling in Amazon DynamoDB.
Estimated Time:3m 0s