An e-commerce checkout application named CartCheckout records transaction logs in Amazon DynamoDB. The table uses CheckoutDate (formatted as YYYY-MM-DD) as the partition key and TransactionID as the sort key. During a flash sale event, the application experiences multiple ProvisionedThroughputExceededException errors when writing to the table, even though the total consumed Write Capacity Units (WCUs) are well below the table's total provisioned limits. Which action should the developer take to resolve the write throttling and optimize the table's write performance?
- Redesign the partition key schema to use the high-entropy TransactionID as the partition key, or append a random suffix to the CheckoutDate, to distribute writes evenly across partitions.Answer
- BIncrease the overall provisioned Write Capacity Units (WCUs) of the DynamoDB table to handle the high volume of write traffic during the flash sale.
- CPlace an Amazon SQS queue in front of the DynamoDB table and configure a longer queue visibility timeout to prevent write failures.
- DConfigure the application SDK client initialization by hardcoding AWS IAM access keys with higher write privileges to prevent API rate limiting.
Answer
Redesign the partition key schema to use the high-entropy TransactionID as the partition key, or append a random suffix to the CheckoutDate, to distribute writes evenly across partitions.
The correct answer is correct because replacing the partition key with a high-entropy key (like TransactionID) or adding a random suffix to the date distributes the data and request load evenly across all available physical partitions. This avoids hot partition bottlenecks where a single partition key receives all writes.
Step-by-Step Solution
Key Concept
Identifying and resolving hot partitions in Amazon DynamoDB by designing high-entropy partition keys or implementing write sharding.