4

I have a dynamodb table with lots of partition keys. Most of these partitions contain just one item with a few attributes. Is this bad practise? Is there anything I should be concerned about?

Harish Nair
  • 159
  • 4

2 Answers2

6

Having as sparse hash/partition keys as possible is the best approach, whenever possible, as DynamoDB has much more flexibility in allocating data in partitions.

Worst example is to have a huge partition, which may lead to storage (10GB) limit issue and hot partitions.

If you are referring that you have many small items in a table instead of fewer large items, again, it is much better.

Horatiu Jeflea
  • 7,256
  • 6
  • 38
  • 67
0

There is no good or bad strategy on a definition of a partition created on dynamodb tables. It always helps to have a strategy in place to have similar items placed in the same partitions. This ensures that end-users querying on similar datasets would end up querying the same partitions.

It also makes a case for healthy and balanced partitions definition for tables so that there are no hot or cold (or imbalanced) partitions created which may result in certain partitions are highly utilized while others are not.

Raunak Jhawar
  • 1,541
  • 1
  • 12
  • 21