
Ask HN: Has anyone migrated a Mongo db to Azure Cosmos witho draining credit? - emadehsan
I created Azure CosmosDB instance for MongoDB APIs and migrated my existing database to Cosmos. There was a restriction on unique indexes that: Unique indexes can only be created when collection is empty. So I emptied collection by &quot;removing documents&quot;. But index won&#x27;t appear. I dropped collection and created indexes and restored the collection from backup. Plus, during testing this out, I created and dropped individual collections &amp; whole database 4-5 times in duration of 24 hours. I woke up to see that the cost incurred on Cosmos was $144 for requests made during last day. Database size is hardly 300KB when compressed (so around a couple MBs).<p>I still have not been able to get my head around RUs (Request Units). Docs say: A request unit is a normalized measure of request processing cost. But IMHO, RUs are much expensive [1]. What was your experience migrating&#x2F;maintaining Mongo to Cosmos?<p>[1] https:&#x2F;&#x2F;docs.microsoft.com&#x2F;en-us&#x2F;azure&#x2F;cosmos-db&#x2F;request-units#estimating-throughput-needs
======
mat_keep
Hi Have you tried using MongoDB Atlas for your Mongo database? It's an on-
demand, fully managed database service that you can provision on Azure, AWS,
or GCP (so no lock in to any 1 cloud provider)
[https://www.mongodb.com/cloud/atlas](https://www.mongodb.com/cloud/atlas)

It includes a free tier for experimentation and evaluation (currently only
available on AWS)

And as this is real MongoDB, rather than a Cosmos shim of the APIs, all the
features of MongoDB actually work....

Disclosure: I work at MongoDB

------
Zekio
I would recommend using [https://docs.microsoft.com/en-us/azure/cosmos-
db/local-emula...](https://docs.microsoft.com/en-us/azure/cosmos-db/local-
emulator) when testing stuff related to Cosmos DB

~~~
emadehsan
Thanks Zekio. I think this emulator would be much handy next time.

