Soru

Zorluk: OrtaResolving DynamoDB Throttling and Key Distribution Issues

A logistics delivery application named 'RouteSpeed' updates the status of packages in an Amazon DynamoDB table. The partition key is `delivery_date` and the sort key is `package_id`. During peak delivery hours on a major shopping holiday, the application encounters a high rate of `ProvisionedThroughputExceededException` errors. CloudWatch metrics indicate that the table's total consumed write capacity is well below the provisioned write capacity.

Which TWO actions should the developer take to resolve these throttling issues? (Select TWO.)

  1. Redesign the partition key schema by appending a randomized or calculated suffix to the partition key value to distribute write requests across multiple physical partitions.Cevap
  2. Configure the AWS SDK client in the application to use exponential backoff and jitter for retrying throttled write requests.Cevap
  3. C
    Increase the visibility timeout of the Amazon SQS queue that feeds the status updates to the application to prevent messages from returning to the queue.
  4. D
    Modify the application to perform a Scan operation instead of a Query operation to verify if a package partition has available capacity before writing.
  5. E
    Hardcode static AWS credentials in the application's SDK client configuration to bypass the default credential provider chain and reduce connection establishment latency.

Cevap

To resolve the throttling issues, the developer must redesign the partition key schema by appending a suffix to distribute writes and configure the AWS SDK client to use exponential backoff and jitter for retrying failed requests.
Redesigning the partition key by appending a randomized or calculated suffix distributes the write load across multiple physical partitions, preventing a single partition from becoming hot. Additionally, configuring the SDK client with exponential backoff and jitter ensures that the application handles temporary write spikes gracefully by retrying requests after increasing delays.

Adım Adım Çözüm

1
Analyze the table configuration and error patterns to identify if writes are unevenly distributed.
Discovered that the partition key is a date string with low entropy, causing all writes on a given day to target a single physical partition.
Uneven distribution causes single partition limits to be reached even when the overall table capacity is sufficient.
2
Introduce a calculated suffix (e.g., 11 to NN) to the partition key value during write operations.
Writes are evenly distributed across multiple physical partitions.
Increasing the entropy of the partition key balances the write load.
3
Configure the AWS SDK client to implement exponential backoff with randomized delay (jitter).
Transient throttling errors are automatically retried with spacing to prevent request collisions.
Ensures the application handles transient load spikes without failing operations.

Anahtar Kavram

Mitigating DynamoDB hot partitions and using SDK retry strategies
Bu soruyu puanla