Soru

Zorluk: OrtaData Store Operations with Amazon DynamoDB

A developer is building a high-throughput IoT monitoring application that writes status updates to an Amazon DynamoDB table. The table's partition key is DeviceId (String) and the sort key is Timestamp (Number). During peak times, the application receives a ProvisionedThroughputExceededException during write operations. Amazon CloudWatch metrics show that the overall write capacity consumed by the table is well below the provisioned Write Capacity Units (WCUs), but a few specific devices are writing data at an extremely high frequency. Which two actions should the developer take to resolve this issue and handle the write failures? (Choose two.)

  1. Construct a synthetic partition key by appending a calculated hash or random suffix to the DeviceId to distribute writes across multiple partitions.Cevap
  2. Implement exponential backoff and retries in the AWS SDK configuration to handle the write failures gracefully.Cevap
  3. C
    Increase the provisioned Write Capacity Units (WCUs) of the table to handle the high volume of writes from the active devices.
  4. D
    Run a Scan operation with a FilterExpression on the DeviceId attribute to dynamically locate and throttle the high-volume devices.
  5. E
    Initialize the DynamoDB client using static, hardcoded IAM user access keys in the application code to guarantee high-priority access to the DynamoDB API.

Cevap

Construct a synthetic partition key by appending a calculated hash or random suffix to the DeviceId to distribute writes, and implement exponential backoff and retries in the AWS SDK configuration to handle the write failures gracefully.
The correct options recommend creating a synthetic partition key to distribute hot key writes across multiple partitions and implementing exponential backoff to handle transient write exceptions gracefully.

Adım Adım Çözüm

1
Analyze the cause of the ProvisionedThroughputExceededException.
Identify that a few specific devices (hot keys) are exceeding the single partition write limit of 10001000 write capacity units, even though overall table capacity is sufficient.
This confirms a hot partition issue rather than a table-level capacity shortage.
2
Distribute the write load by modifying the partition key design.
Implement a synthetic partition key strategy where a suffix is added to the DeviceId.
This spreads writes for the same DeviceId across multiple physical partitions, bypassing the single-partition limit.
3
Configure client-side error handling.
Enable exponential backoff and retries in the AWS SDK client initialization.
This handles transient errors gracefully, allowing retried requests to succeed when capacity becomes available.

Anahtar Kavram

Handling DynamoDB hot partitions and transient write throttling through partition key design and client-side retry strategies.
Bu soruyu puanla