A sports media website uses an Amazon DynamoDB table to store live commentary updates for popular matches. During major tournaments, write volume spikes to writes per second. The application requires sub-millisecond read latency for the most active match commentary threads. Currently, the database partition key is a combination of the tournament name and a sequential timestamp (TournamentName_Timestamp). During peak events, the application experiences write throttling and elevated latency. Which configuration should a solutions architect implement to resolve the performance bottlenecks and meet the latency requirements?
- Redesign the partition key using a high-cardinality attribute like a hashed combination of MatchID and CommentaryID, and deploy Amazon DynamoDB Accelerator (DAX) to serve reads.Answer
- BKeep the existing TournamentName_Timestamp partition key to maintain chronological ordering, and deploy DynamoDB Accelerator (DAX) to handle the write cache.
- CMigrate the database layer to Amazon RDS for PostgreSQL, utilizing a single primary instance with multiple Read Replicas configured as the primary failover targets to achieve high performance and immediate disaster recovery.
- DMaintain the current DynamoDB table structure but configure the table with Provisioned Capacity Mode using static read and write capacity settings set to the historical average to prevent throttling.
Answer
Redesign the partition key using a high-cardinality attribute like a hashed combination of MatchID and CommentaryID, and deploy Amazon DynamoDB Accelerator (DAX) to serve reads.
Redesigning the partition key to a high-cardinality key like a hashed combination of MatchID and CommentaryID ensures that writes are distributed evenly across DynamoDB's physical partitions, preventing write throttling. Deploying DynamoDB Accelerator (DAX) fulfills the sub-millisecond read latency requirement by providing an in-memory cache.
Step-by-Step Solution
Key Concept
Avoiding hot partitions in DynamoDB by using high-cardinality partition keys, and using DAX for microsecond read latency.