I’m trying to create on Azure Cosmos DB with MongoDB driver, a new collection.
I’ve reached the limit of 100 collection for account cause it’s a serverless account.
Now I’ve deleted some old databases and collection a couple of days ago to free up some space, but I continue to receive the same error.
What I’m supposed to do to solve the issue?
2
Answers
According to this documentation: https://azure.microsoft.com/en-us/updates/cosmos-db-25-container-limit/
The number of collections is limited to 25 per database. So when you deleted other databases, it did not affect that you are at the limit for the database that you are working with.
Also there is a cost element. The cost increases with the number of collections. So you should consider if you really need them.
Serverless accounts are limited to 100 collections per account, documented here in service quotas, https://learn.microsoft.com/azure/cosmos-db/concepts-limits#serverless-1.
If you are expecting more than 100 collections across all databases in the account, I’d recommend using the MongoDB vCore service. Unlike the RU-based model this is single-instance, VM-based, and can be a better fit when migrating existing MongoDB workloads, particularly those with large numbers of small collections. You can start here to learn more, https://learn.microsoft.com/azure/cosmos-db/mongodb/vcore/introduction.