Sandeep540
Sandeep540

Reputation: 977

Writing to Azure Cosmos , Throughput RU

We are planning in writing 10000 JSON Documents to Azure Cosmos DB (MongoDB), Does the Throughput Units matter, if so, can we increase for the batch load and set it back to low number

Upvotes: 1

Views: 497

Answers (2)

David Makogon
David Makogon

Reputation: 71035

You can scale the RU/sec allocation up or down at any time. You'll want to look at your insertion cost (RU cost is returned in a header) for a typical document, to get an idea of how many documents you might be able to write, per second, before getting throttled.

Also keep in mind: if you scale your RU out beyond what an underlying physical partition can provide, Cosmos DB will scale out your collection to have additional physical partitions. This means you might not be able to scale your RU back down to the bare minimum later (though you will be able to scale down).

Upvotes: 0

David C
David C

Reputation: 521

Yes you can do that. The lowest the RUs can be is 400. Scale up before you're about to do your insert and then turn it down again. As always, that part can be automated if you know when the documents are going to be inserted.

Check out the DocumentClient documentation and more specifically ReplaceOfferAsync.

Upvotes: 2

Related Questions