0
votes

We are having production cosmosdb collection WITHOUT PARTITION KEY, now we have decided to introduce PARTITION KEY, it is understood it requires new collection creation with partition key & data migration with production downtime. All our collections having /id property which unique for a given collection. Question is, will /id would be ideal candidate for partition key? if so what are pros & cons?please suggest.

1

1 Answers

0
votes

First of all you should have a look at the documentation of choosing partition key from the official docs

If you are going to use id as partition key, you'll need to check/understand if you are querying data on a property other than id, since you will be forced to do a cross-partition query. If not Id would be a good selection as Partition Key