简体   繁体   中英

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM