Ravindra BagaleCourses & study guides मराठी Track your progress

Ravi Sir's Cards › AWS

AWS Cloud

Partition key and sort key

This revision card explains Partition key and sort key. It starts from the need that bad keys create hot partitions and slow queries. It describes pK spreads data. SK orders items that share a PK for range queries. The how-to section notes design from access patterns first — what will you Query? An example on the card is userId + createdAt lets you list one user's notes newest first.

Partition key and sort key Bad keys create hot partitions and slow queries. PK spreads data. SK orders items that share a PK for range queries. Design from access patterns first: what will you Query? userId + createdAt lets you list one user's notes newest first.
Partition key and sort key · Download PNG
Read card text

What this card says

Why do we need it?

Bad keys create hot partitions and slow queries.

What is it?

PK spreads data. SK orders items that share a PK for range queries.

How to do it

Design from access patterns first: what will you Query?

PK userId SK noteId

Example

userId + createdAt lets you list one user's notes newest first.

See all AWS revision cards