In this talk people will get to know how we can use change feed feature of Cosmos DB and use azure functions and signal or service to develop a real time dashboard system
In this talk people will get to know how we can use change feed feature of Cosmos DB and use azure functions and signal or service to develop a real time dashboard system
CREATING REAL TIME DASHBOARD WITH BLAZOR, AZURE FUNCTION COSMOS DB AN AZURE SIGNALR SERVICE
1.
Real time
Dashboard with
CosmosDb,Azure
Functions, Azure
SignalR service and
Blazor
By Mangesh Gaherwar
2.
Meet our Developer Mr. J
Asked to design a system which
will give user the real time
update of the weather
3.
Polling Based Dashboard
Traditional approach which will be timer based fetching of the data from server
4.
Issues with this approach…
Issues with this approach
Client tries to
connect server data
is available or not
Selecting Time
interval is also
difficult.
Once data is returned
then client app is
updated regardless of
any change in data or
not
As the application
grow amount of
data exchanged
between client and
server become a
problem
5.
Whats the
Solution ????
• Design a system which will
reduce this issues as reducing
the traffic to the server and
making sure the UI is updated
whenever the data changes .
Image source : Microsoft docs
Data is added
in Cosmos Db
As Data changes
Azure Cosmos
Db exposes a
Change feed Triggers the Azure
function which use
the Cosmos Db
Trigger
Using SignalR
output binding
Publishes
message to
Clients
6.
Azure functions development with Cosmos
Db change feed
• CosmosDBTrigger : Trigger used to invoke the function
• databaseName : Name of the Database
• collectionName : Name of the container
• ConnectionStringSetting : Key Name from app setting which holds the
connection string to the Cosmos Db
• LeaseCollectionName : Name of the lease collection
7.
Azure SignalR service Configurations
Azure Service configuration
mode
Default Serverless
Classic
8.
Azure functions with Azure SignalR
service
SignalR Service Bindings
Trigger Binding
Input Binding
Output Binding
9.
You can find me
at
• Twitter : @dotnetgik1
• Linkedin : Mangesh Gaherwar
• Blog : www.dotnetgik.com