DEV Community

loading...

Discussion on: Understanding Partitioning in Azure Cosmos DB

Collapse
nilsottesen profile image
nilsottesen

Will,
I’m experimenting with choosing the right partition key for my Cosmos DB graph database.
Every node has a unique id value (a deterministic SHA256 hash), and I chose to use that value as partition key as well.
This results in maximum cardinality, and it seems to provide a very good spread across the partitions.
I can’t find any articles discussing or recommending this approach though, so can I get your opinion?

Cheers,
-Nils

Collapse
jgarplind profile image
Joel

Hi Nils,

I think that approach misses out on a key intent of partition keys - logical grouping. I.e. if items tend to be fetched together, they ideally reside in the same partition. My source is this 15 min video which acted as my entry into Cosmos partition keys: youtube.com/watch?v=5YNJpGwj_Zs

Collapse
nilsottesen profile image
nilsottesen

Thx Joel :-)