Scrivio Interview library
DebuggingIntermediate7 min read · updated 12 November 2026

A DynamoDB table backing an order service throttles with ProvisionedThroughputExceededException during a sale, even though total consumed capacity is far below the table's limit. What is likely happening and how do you fix it?

This is almost certainly a hot partition: during the sale, a large share of requests target the same partition key, such as today's date or one popular product id, and DynamoDB limits each partition to about 3,000 read units and 1,000 write units per second no matter how much capacity the table has in total. We confirm it with CloudWatch Contributor Insights, which shows the most accessed and most throttled keys, and fix it by choosing keys that spread load or by write sharding, adding a shard suffix to the hot key and aggregating on read. On-demand and adaptive capacity help with spikes but do not remove per-partition limits, so we also configure retries with exponential backoff and jitter and put DAX or a cache in front of hot reads.

Why this question is asked

Throttling that appears when total consumption is far below the table's limit confuses many teams, because the dashboard says there is plenty of capacity. The explanation lies in how DynamoDB spreads a table across partitions. Interviewers ask this debugging question because it tests whether we understand that distribution, can find the cause with the right tools, and know which fixes remove it and which only soften it. In this answer, we will recap partitions and their limits, reproduce how a sale creates a hot key, find it, fix it with key design and write sharding, and see the role of capacity modes, retries and caching.

1A Quick Recap: Partitions and Their Limits

DynamoDB stores a table in partitions, internal units of storage and throughput. It hashes each item's partition key to decide which partition holds it, so one partition key value always lives in exactly one partition. Each partition can serve at most roughly 3,000 read capacity units and 1,000 write capacity units per second, where one write unit is one write of up to 1 KB.

The table's capacity, provisioned or on demand, is spread across many partitions. A table provisioned for 20,000 writes per second may have dozens of partitions. If traffic is spread evenly, all of that is usable. If most writes hit one key, they all land on one partition, which throttles at about 1,000 per second while the rest sit idle. Total consumed capacity looks low exactly because the other partitions are doing nothing.

Load during the sale
PartitionKeys it holdsWrites per secondResult
P1ORDERS#2026-11-28 (today)4,800throttled above ~1,000
P2older dates40idle
P3older dates35idle
Table total~1,900 accepted of 20,000 provisionedlooks healthy

2How the Sale Creates a Hot Key

A common design for orders is a table with the order date as partition key and the order id as sort key, because the operations team likes listing today's orders. On a normal day, writes are a few hundred per second and the date key is fine. During a sale, every new order goes to the same partition key, today's date, at thousands per second. The same thing happens with a counter item per product, such as stock for the advertised product, which every order updates.

Java
// partition key = order date: every order today shares one key
orders.putItem(new OrderItem("ORDERS#2026-11-28", "o-" + id, ...));
// at 4,800 orders per second:
// software.amazon.awssdk.services.dynamodb.model.ProvisionedThroughputExceededException:
// The level of configured provisioned throughput for the table was exceeded ...
// stock counter: one item, one key, updated by every order of the advertised product
UpdateItem key=PRODUCT#p-7 SET stock = stock - :q CONDITION stock >= :q

3Finding the Hot Key

The fastest way to confirm a hot partition is CloudWatch Contributor Insights for DynamoDB, which, once enabled on the table or an index, shows the most accessed partition keys and the most throttled keys over time. If one or two keys account for most throttled requests, the diagnosis is done. CloudWatch metrics such as ThrottledRequests and WriteThrottleEvents, compared with consumed capacity, show the throttling at table level, but only Contributor Insights shows which keys are responsible.

Before the next sale, we also think through the access pattern on paper: for each key, how many requests per second will one value receive at peak? Any value expected above about 1,000 writes or 3,000 reads per second is a hot key waiting to happen.

Step throughDiagnosing the throttling
  1. Throttling with low total consumption
  2. Contributor Insights: one key dominates?
    YesHot partitionNoCheck GSI throttling and capacity settings
  3. Hot key is written or read?
    YesWrites: change key or shard itNoReads: cache or DAX, then key design
  4. Retest with a load test at sale volume

4 steps in order. Play them, or step through them one at a time.

4Fix 1: Better Keys

The best fix is a partition key with many distinct, evenly used values. Orders keyed by order id, or by customer id with the date in the sort key, spread naturally, because thousands of customers order at the same time. Listing today's orders, which the date key was serving, moves to a global secondary index whose key is designed to spread too, or to a stream feeding a reporting store. Notice that a GSI has the same per-partition limits, so a GSI keyed only by date is just as hot as the table was.

5Fix 2: Write Sharding for Keys That Must Stay Hot

Some keys are hot by nature, such as a daily partition used for time-ordered listing or a counter for the advertised product. Write sharding spreads one logical key over several physical keys by adding a suffix, a shard number, either random or computed from something like the order id. Readers then query all shards and combine the results.

Java
int SHARDS = 10;
String pk = "ORDERS#2026-11-28#" + Math.floorMod(orderId.hashCode(), SHARDS); // ORDERS#2026-11-28#0..9
orders.putItem(new OrderItem(pk, "o-" + orderId, ...)); // spread over 10 partitions
// reading today's orders: query the 10 shards and merge by sort key
List<OrderItem> today = IntStream.range(0, SHARDS).parallel()
.mapToObj(s -> queryShard("ORDERS#2026-11-28#" + s))
.flatMap(List::stream)
.sorted(comparing(OrderItem::getSk)).toList();
// stock counter: split stock across 10 items; decrement a random one, sum all 10 to read the total

With ten shards, the ceiling for that logical key rises from about 1,000 to about 10,000 writes per second. A computed suffix, from the order id, has the advantage that the application can find a specific item again without querying all shards. The cost is on the read side: ten queries instead of one, which is why we shard only keys that truly need it.

6Capacity Modes, Retries and Caching

On-demand capacity lets the table absorb sudden increases without provisioning, and adaptive capacity, which is on by default, shifts unused throughput towards busy partitions and can split partitions holding several hot keys. Both help with spiky traffic, but neither raises the limit for a single partition key value, so a single hot key still throttles. They complement key design rather than replace it.

The SDK retries throttled requests automatically, but during a sale we should make sure retries use exponential backoff with jitter, randomised and growing delays, so thousands of clients do not retry in lockstep and throttle again; check the default retry strategy and attempt count for your SDK version and tune them. For hot reads, such as the product page of the advertised item, DAX, DynamoDB's in-memory cache, or an application cache such as Redis serves repeated reads without touching the partition. Finally, we load test at sale volume before the sale, because the hot key only shows up under realistic traffic.

7Follow-up questions

Why does the error say provisioned throughput exceeded if the table has spare capacity?

Because the limit being exceeded is that of one partition, not of the table. DynamoDB reports it with the same exception, which is why the table-level metrics look misleading.

How many shards should we use?

Enough to keep each shard under the per-partition limit at expected peak with headroom: for 4,800 writes per second, at least five, and ten for safety. More shards mean more queries per read, so we size it from measured peak, not guesswork.

8Conclusion

In this answer, we traced throttling with low total consumption to a hot partition: during the sale, one partition key such as today's date or a popular product received far more than the roughly 1,000 writes or 3,000 reads per second one partition allows. Contributor Insights shows the hottest and most throttled keys. The fixes are keys that spread load naturally and write sharding with aggregation on read for keys that must stay hot, while on-demand and adaptive capacity soften spikes without removing per-partition limits, retries need exponential backoff with jitter, and DAX or a cache absorbs hot reads.

What to say in the interviewAbout 100 seconds aloud

Open with

Throttling with low total consumption almost always means a hot partition. DynamoDB splits the table into partitions by hashing the partition key, and each partition handles roughly 1,000 write units and 3,000 read units per second, regardless of the table's total capacity.

Then, if they want more

During a sale, if the partition key is something like the order date, every order today hits the same key and so the same partition, which throttles at about a thousand writes per second while the other partitions sit idle. That's why the table-level metrics look fine. Same with a stock counter item for the advertised product.

To confirm it, I enable CloudWatch Contributor Insights on the table, which shows the most accessed and most throttled keys. The real fix is the key design: a high-cardinality partition key like order id or customer id, with the date in the sort key, and a GSI that is itself sharded if we need listing by date.

For keys that have to stay hot, I use write sharding: append a shard number, computed from the order id or random, so one logical key spreads over ten partitions, and readers query all shards and merge. On-demand and adaptive capacity help with spikes, but they don't remove the per-partition limit.

I'd also make sure the SDK retries with exponential backoff and jitter, put DAX or a cache in front of hot reads like the product page, and load test at sale volume beforehand.

About this answer

Last updated
12 November 2026
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Official documentation
Spring Data reference
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "A DynamoDB table backing an order service throttles with...": https://scrivio-interview-library.netlify.app/databases/spring-data-nosql/3063fe21d8/