Can cosmos DB be used without sharding/partitioning enabled?

Viewed 161

We want to migrate from native mongoDB to Azure-hosted cosmosDB. While creating collections we see a field "shard key" which is mandatory, but currently our mongo DB set-up does not support sharding. Is it possible to migrate to cosmos without enabling sharding and with only minimal changes in our application?

2 Answers

Yes, it's possible. Option is right there in the portal when provisioning a new collection.

enter image description here

I guess the cosmos UI behaves weirdly. When I try to create a new collection by clicking on the ellipses button on a DB or choose existing DB, it doesn't provide the option to create collection without supplying shard key.

new collection in a DB When I create a new collection and choose to create a new DB then and there, and choose not to have a shared throughput, in that case only I get the option to create collection without sharding.

enter image description here

Related