If I want to update several hundred documents in my Cosmos Db collection, do I use a stored procedure or bulk update?
I'm just trying to do a standard T-SQL style UPDATE so:
- The update doesn't really require a
TRANSACTIONso all pass or all fail is not a requirement. Of course, if the operation has failed I need to know but that doesn't mean all the successful ones need to revert back to their previous values. - The operation is not super time sensitive but I'm concerned about its cost. Up to a few seconds to complete the operation is perfectly acceptable but I do want to minimize the cost as much as possible.
Up until I read a line in the docs, I was considering using a stored procedure but this line has made me stop and think about the best option for this type of operation.
Because stored procedures can execute code and consume any number of request units (RUs), each execution requires an upfront charge.
Which is the right solution for my scenario, a stored procedure or bulk update?