DynamoDB interview question · Most asked

What is a hot partition, and how do you avoid one?

Summary

A hot partition receives far more traffic than others, usually because many requests share one partition key value (a celebrity user, today's date as key, a global counter). It throttles even when the table has spare capacity overall. Avoid it with high-cardinality keys and, for unavoidable hot keys, write sharding or caching.

Longer Answer

Techniques:

  • Choose keys with many values and even access (user ID, not country).
  • Write sharding: append a suffix (EVENT#2026-10-17#7, suffix 0-9 chosen randomly or computed from an attribute) and read all shards in parallel.
  • Cache hot reads (DAX or an application cache).
  • Aggregate writes (buffer counters in memory or a queue) instead of writing one item per event.

CloudWatch Contributor Insights shows the most accessed keys, which is how you find hot partitions in practice.

Key Points

  • Traffic concentrated on one key.
  • High-cardinality keys.
  • Write sharding with suffixes.
  • Cache hot reads; Contributor Insights to find them.

More most-asked DynamoDB questions

← All DynamoDB questions