0

One colleague said that cosmos db will stop supporting collections without a partition key. But I can't find any information about this statement from Microsoft.

The application I'm working on has a collection of order records. A typical query returns 10s of thousands of these records. So if I use order id as partition key, it'll always run cross partition queries.... And the requirement is to get all records across all tenants, so partition by tenant id isn't an option, either.

I thought it'll be fine just create a collection without a partition key. I'll worry about archiving data later (probably with azure functions and change feed).

Is it a good idea to do so?

Allen Zhang
  • 2,432
  • 2
  • 20
  • 31
  • For anyone looking for more official information on the subject, this article seems to confirm that cosmos is heading that way: https://learn.microsoft.com/en-us/azure/cosmos-db/migrate-containers-partitioned-to-nonpartitioned Which begs the question how do you decide on a partition even before you know what your business model would look like... – nieve Oct 15 '20 at 10:37

1 Answers1

1

One colleague said that cosmos db will stop supporting collections without a partition key. But I can't find any information about this statement from Microsoft.

Based on the tips on the cosmos db portal,this message is confined to portal only so far.

enter image description here

You still could create non-partitioned collection by using sdk:

DocumentCollection collection = new DocumentCollection();
collection.set("id","jay");
ResourceResponse<DocumentCollection> createColl = client.createCollection("dbs/db",collection,null);

So,i think your service will not be affected by now. As for future trends, I suggest you pay more attention to Microsoft's official statement. If you have any special needs, you can submit feedback for help.

Jay Gong
  • 23,163
  • 2
  • 27
  • 32