An e-commerce application named "FlashRetail" writes customer transaction records to an Amazon DynamoDB table. The table partition key is configured as the transaction date (format: ). During a high-volume flash sale event, the application experiences write throttling and encounters errors, even though the total consumed capacity is well below the table's overall provisioned write limit.
Which of the following actions should the developer take to resolve this throttling issue?
- AModify the application retrieval logic to use Scan operations instead of Query operations.
- BIncrease the overall provisioned Write Capacity Units (WCUs) of the DynamoDB table.
- Redesign the partition key schema by appending a random suffix to the transaction date to distribute writes across multiple partition keys.Cevap
- DIncrease the Amazon SQS visibility timeout for the queue processing the incoming transaction messages.
Cevap
Redesign the partition key schema by appending a random suffix to the transaction date to distribute writes across multiple partition keys.
The correct action is to redesign the partition key schema by appending a random suffix. The transaction date () has low cardinality during a high-traffic event, causing all writes to target the same partition key. Appending a random suffix (sharding) distributes the write operations across multiple distinct partition key values (e.g., , ), resolving the hot partition bottleneck.
Adım Adım Çözüm
Anahtar Kavram
Avoiding hot partitions in DynamoDB by distributing writes using partition key sharding (adding random suffixes).
Tahmini Süre:45s