Soru

Zorluk: OrtaResolving DynamoDB Throttling and Key Distribution Issues

An order ingestion application named OrderSync processes real-time transaction updates and writes them to an Amazon DynamoDB table. The table is configured with provisioned write capacity. During high-traffic flash sales, the application experiences a high rate of ProvisionedThroughputExceededException errors. CloudWatch metrics indicate that the overall write capacity consumption is well below the table's provisioned limit, but the write operations are concentrated on a small number of partition keys representing trending items.

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

  1. Modify the application's write logic to append a random numeric suffix to the partition key for high-volume items to distribute writes across multiple partitions.Cevap
  2. Implement exponential backoff and jitter in the application's SDK client retry configuration to handle transient throttling errors.Cevap
  3. C
    Change the database read operations to use Scan instead of Query to bypass partition throughput limits.
  4. D
    Increase the visibility timeout of the SQS queue that feeds the application to give DynamoDB partitions more time to complete write operations.
  5. E
    Hardcode the access keys of an IAM user with administrator permissions in the AWS SDK client to bypass provisioning limits.

Cevap

Modify the application's write logic to append a random numeric suffix to the partition key for high-volume items, and implement exponential backoff and jitter in the application's SDK client retry configuration.
The correct options are to append a random numeric suffix to the partition key (which spreads the write requests across multiple physical partitions, preventing individual partition limit exhaustion) and to configure the AWS SDK with exponential backoff and jitter (which handles temporary spikes in write requests without failing the transactions outright).

Adım Adım Çözüm

1
Analyze the CloudWatch metrics and throttling errors.
Identified that the ProvisionedThroughputExceededException is caused by a hot partition key issue where writes are concentrated on a few trending items.
Before applying a fix, the developer must confirm whether the throttling is due to overall capacity exhaustion or uneven key distribution.
2
Apply write sharding using a random suffix.
The write requests are distributed across multiple partitions by appending a suffix, preventing a single partition from bearing the entire load.
DynamoDB partitions have a hard limit of 1000 WCU and 3000 RCU per partition. Distributing hot keys via sharding avoids hitting individual partition limits.
3
Configure the SDK retry policy with exponential backoff and jitter.
Transient throttling spikes are handled gracefully by retrying requests at randomized intervals.
Jitter prevents a 'thundering herd' problem where retried requests arrive simultaneously, causing repeated throttling.

Anahtar Kavram

Resolving DynamoDB throttling issues by avoiding hot partitions through partition key sharding and handling transient failures using backoff and jitter.
Bu soruyu puanla