Why you shouldn’t use CosmosDB for MongoDB?


Cosmos DB is SAAS service provided by Azure. It provide different integrations with different type of DB (MongoDB, Cassandra, SQL…). In paper, it seem so powerful with unlimited resources but it reality you will have at the end of the month a big bill to pay. In production, we uses provisioned throughput for SLA. At the beginning, it seem costless and you have an advisor to help reduce the cost. After some time, the data in CosmosDB begin to grow from Go to To and the price has tripled. When you set a collection or a database to autoscale, the autoscale depend on the amount of data stored (for instance, when you are at 30Go, the autoscale can be set to max 4000RU/s ~ 200$. If you have 1To on a collection, the minimum will be set to 100000RU/s ~ I let figure out the numbers). At all times, you will be limited with the data stored. When the data stored increase, RU/s will increase too.

More further, if want to archive data from collections. There’s no solution ready to use in CosmosDB. You will have to use (Data factory or Synapse).

For alternative, you can do

  • Mongo Atlas (promising solution but it depend on the use cases + has ready to use solution to archive data)
  • Cluster Mongo using Operator Percona (it’s definitely more cheaper but it require more monitoring and managing all by you self)

At the end, there’s no best solution it depend for each use case.


Leave a Reply

Your email address will not be published. Required fields are marked *