4 ms·
To the brave, I recommend trying to make a copy of a CosmosDb collection. The only solution that doesn't require spinning up a VM, reading all the data and wri
by maltalex 8y ago
To the brave, I recommend trying to make a copy of a CosmosDb collection.
The only solution that doesn't require spinning up a VM, reading all the data and writing it back again is the Azure Data Factory [0]. Which according to Azure's own benchmarks [1] manages to copy only 2MBps between two CosmosDb instances each with 100,000 RUs ("Resource Units"). That's more than half a day for a small 100GB collection.
And in case you're wondering whether 100K RUs is a lot, consider the cost: 5840$/Month for single-region writes. 11680$/Month for multi-region writes [2].
Oh, and as a bonus - can you guess the official procedure for restoring a collection from a backup? [3]:
> If you have accidentally deleted or corrupted your data, you should contact Azure support within 8 hours so that the Azure Cosmos DB team can help you restore the data from the backups.
And yeah, it's 8 hours because they backup the database every 4 hours and keep the last two backup copies [3]
[0]: https://docs.microsoft.com/en-us/azure/data-factory/introduction https://docs.microsoft.com/en-us/azure/data-factory/introduc...
[1]: https://docs.microsoft.com/en-us/azure/data-factory/copy-activity-performance https://docs.microsoft.com/en-us/azure/data-factory/copy-act...
[2]: https://azure.microsoft.com/en-us/pricing/details/cosmos-db/ https://azure.microsoft.com/en-us/pricing/details/cosmos-db/
[3]: https://docs.microsoft.com/en-us/azure/cosmos-db/online-backup-and-restore#automatic-and-online-backups https://docs.microsoft.com/en-us/azure/cosmos-db/online-back...
- llcoolv 8y agoI am sorry to have to argue, but the multi-region writes are calculated N + 1, where N is the number of regions. So it would actually set you back $17520 [0]. And yes, I know that even their own documentation and calculator conflict on this, but they do charge the higher number. 0. https://docs.microsoft.com/bg-bg/azure/cosmos-db/optimize-cost-regions https://docs.microsoft.com/bg-bg/azure/cosmos-db/optimize-co...
- maltalex 8y agoEven better.
- rnehme 8y agoHi, I am from Azure Cosmos DB Engineering Team. We are in the process of updating the Azure pricing calculator to provide various options (e.g., # of regions, single vs. multi-master, etc.). The updates to the calculator are coming shortly. In the meantime, please feel free to ping us at AskCosmosDB@microsoft.com, if you need any help with cost estimates or have any questions.
- manigandham 8y agoWhy is using a VM not allowed? They have the Bulk Executor for large scale update/ingest: https://docs.microsoft.com/en-us/azure/cosmos-db/bulk-executor-dot-net https://docs.microsoft.com/en-us/azure/cosmos-db/bulk-execut... You can also use the changefeed system which is stored as an event-hub stream and then save it to another collection using Azure Functions.