Soru

Zorluk: OrtaResolving DynamoDB Throttling and Key Distribution Issues

A news publishing platform named 'PressPulse' records real-time article view events in an Amazon DynamoDB table. The table is configured with provisioned write capacity and uses ArticleCategory as the partition key. During breaking news events, views for a single category spike dramatically, resulting in ProvisionedThroughputExceededException errors, even though the total consumed capacity is well below the table's total provisioned threshold. Additionally, the application's SDK client fails immediately without retrying when a write request is throttled. Which TWO actions should the developer take to resolve the throttling and improve application resilience? (Select TWO.)

  1. Append a random integer suffix to the partition key value before writing to distribute the write load across multiple partition keys.Cevap
  2. Configure the AWS SDK client to use exponential backoff and jitter for retrying throttled write requests.Cevap
  3. C
    Increase the visibility timeout of the Amazon SQS queue that buffers incoming page view events.
  4. D
    Execute a Scan operation with a filter expression on the backend to distribute read and write capacity usage.
  5. E
    Hardcode credentials for a secondary IAM user with full DynamoDB permissions in the SDK client configuration to bypass limits.

Cevap

To resolve the throttling and improve resilience, append a random integer suffix to the partition key value (write sharding) and configure the AWS SDK client to use exponential backoff and jitter for retries.
Appending a random integer suffix to the partition key (such as ArticleCategory) distributes the write load across multiple partition keys and physical partitions, alleviating the hot partition throttling issue. Configuring the AWS SDK client with exponential backoff and jitter allows the application to handle transient throttling errors gracefully by spreading out retry attempts.

Adım Adım Çözüm

1
Analyze the cause of the ProvisionedThroughputExceededException.
Identify that a single ArticleCategory (the partition key) is receiving disproportionate traffic, creating a hot partition key.
Throttling occurs at the partition level when a single partition key's throughput limit is exceeded, even if the overall table capacity is not.
2
Implement write sharding by modifying the partition key schema.
Append a random integer suffix (e.g., ArticleCategory_1, ArticleCategory_2) to distribute writes across multiple partition keys.
This spreads the traffic across multiple physical partitions, resolving the hot partition issue.
3
Configure client-side error handling.
Modify the AWS SDK client settings to enable exponential backoff and jitter for failed requests.
This allows the client to retry throttled requests gracefully rather than failing immediately, smoothing out traffic spikes.

Anahtar Kavram

Resolving DynamoDB throttling issues caused by hot partition keys using write sharding and configuring client-side SDK retry logic with backoff and jitter.
Bu soruyu puanla