5 ms·
You also forgot to mention that it is crazy expensive if you have lots of collections
by tasubotadas 8y ago
You also forgot to mention that it is crazy expensive if you have lots of collections
- unoti 8y agoI usually put multiple document types into a single collection and have a “type” field to get around this. The fields are indexed so this is efficient. To decide when to use a different collection I look at the scalability and other settings at the collection level, and group things that have similar needs together.
- tracker1 8y agoIf you only have a few "type" options, that may be a poorly performing index unless it's used as a secondary to a query that narrows results more.
- llcoolv 8y agoIt actually supports throughput provisioning on database-level (or container-level as they sometimes call it). The only catch is that you'll have to recreate the db (on creation is the only time when you can enable it) and data migration is not exactly quick.
- rnehme 8y agoHi, I am from Azure Cosmos DB Engineering Team. @llcoolv has responded and the response is correct. For scenarios where you create a lot of collections/tables, we recommend to provision throughput on a database and share the provisioned throughput among all the containers – to save on costs. You can change the throughput at database exactly like how you will change the throughput at container level. It is the same API, it is supported via CLI, SDK, Rest API and Portal as well. The entry point for database level throughout is 400RUs $24 per month and you can add any number of collections/tables that can share this throughput. You can scale up and down in the increments of 100RUs (or $6/month). Please see the following links for details: [1] https://docs.microsoft.com/en-us/azure/cosmos-db/set-throughput https://docs.microsoft.com/en-us/azure/cosmos-db/set-through... [2] https://docs.microsoft.com/en-us/azure/cosmos-db/how-to-provision-container-throughput https://docs.microsoft.com/en-us/azure/cosmos-db/how-to-prov... [3] https://docs.microsoft.com/en-us/azure/cosmos-db/how-to-provision-database-throughput https://docs.microsoft.com/en-us/azure/cosmos-db/how-to-prov... Please see the sample here for moving data: [4] https://github.com/Azure/azure-documentdb-dotnet/tree/master/samples/ChangeFeedMigrationTool https://github.com/Azure/azure-documentdb-dotnet/tree/master... Thanks!
- tasubotadas 8y agoHello, I am aware that one can provision per database, but as another poster mentioned, you can't change that once a database is created, and also you need to specify something that's called partition keys and that can't be done using MongoDB driver. If I recall correctly, you don't even have examples available for that in CosmosDB Python API. I mean yeah - it's possible. But it is also a pain in the ass.
- rnehme 8y agoHi, I am from Cosmos DB engineering team. Yes, for shared throughput database, you will need to create a new database. - You can create MongoDB API collections with shard keys defined. It is fully supported by MongoDB driver - Support MongoDB collections without shard key specified is coming in May Thank you for the feedback on the docs and the missing code samples. We will add those in the docs. Thanks!
- tasubotadas 8y agoThanks. I wasn't aware that a shard key is mapped to a partition key.