Reputation: 15271
So, if we run an azure function with startFromBeginning=true
, how much of RUs will change feed consume until it reaches current state of the collection?
Or, in other words, how fast will the change feed notifications flow into the azure function?
Upvotes: 0
Views: 419
Reputation: 15603
There is really no easy way to know that.
StartFromBeginning just tells the Function to, instead of initializing the state with the current time and starting to read from now on, to go back in time, to the start of the collection's time, and start to read documents that were saved since then (and that still exist).
If you count the amount of documents that exist previous to you starting the Function, and know their size, you could approximate an RU cost. A Change Feed read for changes return a list of documents and the RU cost depends on the size of the documents (reading 10 1KB documents is cheaper than 10 100KB documents).
As for the speed, it entirely depends on your Function code. The Trigger will read the Change Feed, pick up a batch of changes (the batch size might vary and can be customized too), send those changes to your Function, wait for your Function to finish processing them, and then go pick up more. So the faster your Function works (see https://learn.microsoft.com/azure/azure-functions/functions-best-practices#avoid-long-running-functions) the faster you will go through the previous changes.
Upvotes: 2