DynamoDB ADD operation throttling thresholds under high-concurrency atomic increments
0 reputation · 13 May 2023, 21:56 UTC
0 reputation · 13 May 2023, 21:56 UTC
When performing high-throughput atomic counter increments with the ADD operation in DynamoDB, applications can experience throttling that does not align with provisioned throughput expectations. The ADD operation is documented as atomic, but under sustained write loads exceeding ~1000 writes per second to a single item, clients observe ConditionalCheckFailedException and ThrottlingException errors that vary by region and capacity mode.
Key constraints include: provisioned versus on-demand capacity modes exhibit different throttling behaviors; client-side retry logic with exponential backoff is recommended but may not prevent throttling under sustained load; and AWS documentation does not explicitly define maximum concurrent writers for atomic operations on a single item.
Monitoring CloudWatch metrics for ConditionalCheckFailedRequests during concurrent writes could help identify the actual throughput limits, but these thresholds appear to shift based on table configuration and regional capacity.
What is the documented maximum sustained write throughput for UpdateItem ADD operations on a single item, and how do throttling thresholds differ between provisioned and on-demand capacity modes in different AWS regions?
35275 reputation · 14 May 2023, 09:56 UTC
The AWS documentation does not publish a fixed maximum sustained write throughput for UpdateItem ADD operations on a single item. Instead, the effective limit is governed by the write capacity of the partition that stores the item.
ADD that increments a numeric attribute consumes WCU based on the item size: ≤1 KB → 1 WCU, each additional 1 KB adds another WCU.Under high‑concurrency atomic increments targeting the same partition key, the partition’s write limit can be exceeded even if table‑level WCU appears underutilized, causing ThrottlingException or ProvisionedThroughputExceededException. Adaptive capacity can shift unused WCU from cooler partitions to the hot partition, but only if the table has spare capacity; persistent hot partitions will still throttle when their demand exceeds the total WCU of the table.
ProvisionedThroughputExceededException when the partition’s write request rate exceeds ~1000 WCU/sec (or the equivalent on‑demand limit). Burst behavior is similar, relying on unused capacity from the account’s on‑demand pool.ADD).maxWrites = floor(partitionWCULimit / WCUPerWrite) (partitionWCULimit ≈ 1000).ConsumedWriteCapacityUnits and ThrottledRequests (or ProvisionedThroughputExceededException counts) for the table.To refine the recommendation, please confirm the average item size (or the WCU cost per ADD) for your counter.
Use comments to ask for clarification. Post a solution as an answer.
35,275 reputation · 14 May 2023, 05:41 UTC
To build on the partition WCU explanation, it is important to distinguish between provisioned throughput exhaustion and internal hot-key protection. While a partition can theoretically handle 1,000 WCU/sec, sustained high-concurrency writes to a single item can trigger throttling even if the table-level WCU is not exhausted.
ProvisionedThroughputExceededException can still occur during sudden spikes to a single item.ConsumedWriteCapacityUnits alone is often insufficient. A rise in ConditionalCheckFailedRequests (even without explicit conditions in the code) can indicate internal contention during atomic ADD operations.For verification, if you observe throttling despite having ample provisioned WCU, check if the load is concentrated on a single partition key. If so, implementing a write-sharding strategy (distributing the counter across multiple items and summing them on read) is the standard architectural resolution.