2
votes

Is it possible to register a service running on a cluster node as observer to changefeed for a document collection across multiple cosmos db accounts in th cluster?

In the case of an Azure Function(triggered by ChangeFeed of a document collection), the function needs to be provisioned for each cosmos db account in the cluster.

https://docs.microsoft.com/en-us/azure/cosmos-db/change-feed-processor

https://docs.microsoft.com/en-us/azure/cosmos-db/serverless-computing-database

How can a service API endpoint be triggered by changefeed processor library? Or, how can a service running on a cluster node be registered as an observer to changefeed for a document collection across multiple cosmos db accounts in the cluster?

1

1 Answers

2
votes

Change Feed Processor Library can be used within any console/worker application and running within any host that is able to have your application running. Samples are available on the GitHub repo https://github.com/Azure/azure-documentdb-changefeedprocessor-dotnet#example

The limitation is that one observer can listen to one collection in one account. If you have multiple accounts, each collection (even if they have the same name) is a different collection and requires an individual instance of the Change Feed Processor Library running (collections do not span multiple accounts). This instance could be in the same compute unit as the rest, and it will share the resources (CPU/RAM) or in an independent one.