Question

Difficulty: HardData Store Operations with Amazon DynamoDB

A developer is building a logistics tracking application that records real-time updates for delivery packages. The system uses an Amazon DynamoDB table where the partition key is `DeliveryDate` (formatted as `YYYY-MM-DD`) and the sort key is `TransitTimestamp#PackageId`. During peak hours, the application experiences a high volume of package status updates, resulting in frequent `ProvisionedThroughputExceededException` errors, even though the total consumed write capacity is well below the table's overall provisioned capacity. Which approach should the developer implement to resolve the write throttling issue while maintaining the ability to retrieve items by date?

  1. A
    Increase the table's provisioned Write Capacity Units (WCUs) dynamically during peak hours using an Application Auto Scaling policy.
  2. Append a calculated sharding suffix (such as a random integer between 00 and 99) to the `DeliveryDate` partition key when writing items, and query across all sharded partitions to retrieve data for a specific date.Answer
  3. C
    Perform a `Scan` operation on the table using a `FilterExpression` to retrieve items by `TransitTimestamp` rather than querying the `DeliveryDate` partition key.
  4. D
    Configure the application to initialize the DynamoDB client using static AWS access keys and secret keys hardcoded in the codebase to bypass provisioning limits.

Answer

The approach of appending a calculated sharding suffix (such as a random integer between 00 and 99) to the `DeliveryDate` partition key when writing items, and querying across all sharded partitions to retrieve data for a specific date.
The correct approach is to append a calculated sharding suffix to the `DeliveryDate` partition key. This distributes the write operations across multiple partition keys (and therefore physical partitions), successfully avoiding the physical partition limit of 1,0001,000 WCUs.

Step-by-Step Solution

1
Analyze the root cause of the `ProvisionedThroughputExceededException` errors when overall table write throughput is below provisioned limits.
Identify that the issue is due to a hot partition key (`DeliveryDate`), where all writes for a given day target the same DynamoDB partition, exceeding the 1,0001,000 WCU partition limit.
DynamoDB partitions have individual throughput limits (1,0001,000 WCUs for write and 3,0003,000 RCUs for read) that cannot be exceeded regardless of the table's total provisioned capacity.
2
Design a write sharding strategy to distribute the writes across multiple partition keys.
Add a suffix (e.g., `-0` to `-9`) to the `DeliveryDate` partition key when inserting or updating items.
This distributes the requests across multiple distinct partition keys, spreading the write workload across multiple physical partitions.
3
Adjust the read query pattern to retrieve all items for a given date.
Query all sharded partitions (e.g., `2026-07-15-0` through `2026-07-15-9`) in parallel and merge the results.
Since the data is now distributed across multiple partition keys, the application must query all possible shards to reconstruct the complete dataset for a specific date.

Key Concept

Partition key design and write sharding to prevent hot partitions
Rate this question