An IoT telemetry platform named "VesselTrack" monitors maritime vessel operations. It records real-time sensor updates in an Amazon DynamoDB table. The table has a provisioned write capacity of 5,000 WCU. The partition key is `vessel_type` (e.g., "Cargo", "Tanker", "Passenger") and the sort key is `timestamp`. During peak operational hours, the application experiences frequent `ProvisionedThroughputExceededException` errors when writing cargo ship telemetry, even though the total write volume across the entire table is well below the table's total provisioned WCU limit.
Which TWO actions should the developer take to resolve these throttling issues and optimize the table's performance?
- Redesign the partition key schema by appending a calculated hash of the vessel ID to the vessel type (e.g., Cargo#12a3) to distribute writes more evenly across partitions.Answer
- Configure the application's AWS SDK client to implement exponential backoff with jitter for all write requests.Answer
- CIncrease the provisioned write capacity of the table to 10,000 WCU to accommodate the write throughput for Cargo vessels.
- DAdjust the visibility timeout of the source Amazon SQS queue to be shorter than the DynamoDB write request timeout to prevent message processing duplicates.
- EPerform a DynamoDB Scan operation with a filter expression on vessel_type to group writing requests into bulk operations.
Answer
Redesign the partition key schema by appending a calculated hash of the vessel ID to the vessel type (e.g., Cargo#12a3) to distribute writes more evenly across partitions, and configure the application's AWS SDK client to implement exponential backoff with jitter for all write requests.
The ProvisionedThroughputExceededException is caused by a hot partition key ('Cargo' representing the majority of the writes), which overwhelms a single partition. Redesigning the partition key by adding a hash or suffix distributes the data across more partition keys. Additionally, configuring the AWS SDK with exponential backoff and jitter ensures that temporary retry spikes are handled gracefully.
Step-by-Step Solution
Key Concept
Resolving hot partition keys via key salting and handling throttling with SDK exponential backoff with jitter.
Estimated Time:2m 0s