A mobile gaming application writes daily player high scores to an Amazon DynamoDB table. Although the table's total provisioned write capacity is significantly higher than the aggregate write rate, the application frequently experiences ProvisionedThroughputExceededException errors because all writes use the current date (e.g., YYYY-MM-DD) as the partition key. Which action should the developer take to resolve this throttling issue?
- AIncrease the provisioned Write Capacity Units (WCUs) of the table until the errors stop occurring.
- Change the partition key design to combine the date with a random numerical suffix to distribute write requests across multiple partitions.Cevap
- CReplace the write operations with a Scan operation containing a FilterExpression to query the database items in parallel.
- DAdjust the processing queue's message visibility duration to handle the database write failures.
Cevap
Change the partition key design to combine the date with a random numerical suffix to distribute write requests across multiple partitions.
The correct answer is to modify the partition key design to include a random numerical suffix. This technique, known as write sharding, distributes the writes for a single day across multiple partition keys (e.g., YYYY-MM-DD.1, YYYY-MM-DD.2), thereby distributing the physical partition load and preventing ProvisionedThroughputExceededException errors.
Adım Adım Çözüm
Anahtar Kavram
Resolving hot partition keys in Amazon DynamoDB by introducing write sharding (adding a random suffix) to distribute the load across multiple physical partitions.