Soru

Zorluk: OrtaResolving DynamoDB Throttling and Key Distribution Issues

A logistics routing application named ShipVerify processes shipment status updates and writes them to an Amazon DynamoDB table. The table uses ShipmentID as the partition key. During peak delivery hours, the application experiences a surge in updates for a small subset of high-volume merchant shipments. This results in frequent ProvisionedThroughputExceededException errors, even though the overall write capacity units consumed by the table are well below the provisioned limits. Which of the following actions should the developer take to resolve this issue?

  1. A
    Change the read operations in the application to execute a table Scan rather than a Query to locate shipment records.
  2. Redesign the partition key schema by appending a random suffix to the partition key value for high-volume shipments to distribute writes across multiple partition keys.Cevap
  3. C
    Increase the visibility timeout of the Amazon SQS queue that feeds the updates to ensure messages are not retried too quickly.
  4. D
    Hardcode the AWS IAM access keys directly within the AWS SDK client configuration to reduce latency from credential retrieval.

Cevap

Redesign the partition key schema by appending a random suffix to the partition key value for high-volume shipments to distribute writes across multiple partition keys.
The correct answer is correct because appending a random suffix to the partition key (write sharding) distributes writes across multiple partitions. This prevents a single partition key from absorbing all the write volume and exceeding the per-partition throughput limit of DynamoDB.

Adım Adım Çözüm

1
Analyze the error metrics and access patterns on the DynamoDB table.
Identify that the ProvisionedThroughputExceededException is concentrated on a small set of partition keys (hot keys) due to high-volume merchant shipments.
To pinpoint if the throttling is a result of hot partition limits rather than total table capacity limits.
2
Determine the strategy for distributing writes to resolve the hot partition.
Decide on appending a random suffix to the ShipmentID key value for high-volume shipments.
To distribute the writes for the same logical shipment across multiple physical partitions, which stays within individual partition throughput limits.
3
Adjust the write logic in the application to write keys with a random suffix, and query accordingly.
Traffic is successfully balanced across multiple partitions, eliminating ProvisionedThroughputExceededException errors.
To apply the write sharding design pattern which scales write throughput horizontally across partitions.

Anahtar Kavram

Write sharding using random suffixes to distribute traffic on a hot partition key in DynamoDB.
Bu soruyu puanla