Anil C
Anil C

Reputation: 1065

Data Retrieval using Microsoft Event Hub with Azure Functions and Cosmos Database

We are working on one application where we are using Azure Functions, Event Hub, Cosmos DB, SignalR. We have setup Event Hub to listen all the events coming from front end. We are using CosmosDB which stores data in a single collection. When we add a new record to the collection, we would like to pass this information to the front end so that they can only update the newly added record. But we don't know how this can be done since it is a single collection and it will return all the data. If it would have a SQL database then we could have selected the latest added record.

Any suggestions are highly appreciated.

Upvotes: 0

Views: 348

Answers (1)

Mikhail Shilkov
Mikhail Shilkov

Reputation: 35124

You could subscribe to Cosmos DB Change Feed and then send those changes to front-end with SignalR.

Alternatively, you could have another consumer of the existing Event Hub, and then do notifications based on data from an event.

Upvotes: 1

Related Questions