Can someone point me to some discussions of how to implement a Change Feed for a serverless Cosmos database? I've been studying Mark Brown's CosmicWorks and Jeremy Likness's PlanetaryDocs
- Let's assume that I decided on an Azure function for implementing a change feed... After studying Mark's code I see the change feed console mode program is running continuously. So if I use an Azure function (functions-bindings-cosmosdb-v2-trigger) code, would I benefit from the serverless feature of Azure functions? It looks like that trigger is running continuously just like the process is in Mark's sample code. Can I conclude that Azure would have to continually charge me Azure Function computes even when my serverless Cosmos DB is idle (and charging me very little) for long periods of time?
- Assuming I'm correct and that the Azure function would be continually running up my Azure bill even when my serverless cosmosDB was idle for long periods of time, why would anyone saving money with a serverless Cosmos DB prefer a change feed implemented as an Azure Function? Of course, latency could be an issue. Any other reasons?
- More specifically: what is the merit of implementing a change feed by calling GetChangeFeedProcessorBuilder (line 38) instead of just making a REST or gRPC call to an Azure Function or a ACI or Kubernetes service whenever we make a change to the CosmosDB database? If latency is not a problem, then we have the option of making the the azure function, ACI or Kubernetes service serverless.
Thanks!
Siegfried
Sun Jan 15 2022 Update:
Let me try to clarify bullets 2 & 3: If I use C# code at functions-bindings-cosmosdb-v2-trigger to implement a change feed (for serverless CosmosDB that is mostly idle) in a serverless Azure Function, will the azure function be running continuously (charging me for computes) listening for events? If so, what might be a cheaper alternative strategy to exploit the some serverless feature (serverless Azure Functions or serverless kubenetes pod maybe)?
Tue Feb 01 2022 update:
I think I found the answer to my question here where it says: The following example shows a C# function that is invoked when there are inserts or updates in the specified database and collection.. I think this means that there are no computes charged when the cosmosdb is idle.
I'm still not clear on consumption mode however... Is this a option I set when creating the Azure Function in the azure portal? I could not find a check box for this. See my reply below where I explained that bing/google searched for this.
The Feb 03 2022 Update:
Looks like I was confused because the azure.portal uses the term "serverless" instead of "consumption plan" and apparently these are synonymous.. I'll mark this question as answered.
Thanks
Siegfried