Partition Keys, Sort Keys, and Secondary Indexes

~12 min read

The single most important design decision in DynamoDB — how items are physically organized and looked up.

Partition Keys, Sort Keys, and Secondary Indexes is a Pro topic

Sign in, then upgrade to Pro or Power to unlock this topic and the full AWS curriculum.

Key points

  • Partition Key determines physical storage; queries need it (or an index) to be efficient
  • Low-cardinality or skewed-access partition keys cause 'hot partitions' and throttling
  • Sort Key enables efficient range queries within a shared partition key
  • GSI: new key structure, eventually consistent, addable anytime; LSI: alternate sort key only, defined at creation, supports strong consistency