In a recent effort to add predictive maintenance functionality in one of our products, I came across with SignalR and I though to share my understanding on it.
SignalR is a Software Library or a Service provided by Microsoft that allows us to create Real-Time Applications over HTTP.
Real-Time Application means that when something happens on the Server, all the Clients are going to know immediately.
Examples of Real-Time Applications
- Chat Applications
- Online Gaming
- Video Conference Applications
- IoT Devices
- and Many More
How SignalR Works?
In between Client and a Server, SignalR works as a tunnel. Whenever a client wants data to the server, or send data to the server, or Vice Versa. SignalR tunnel allows the communication at the same time between Client and Server.
Why we use SignalR with IoT Devices Applications?
When we are talking about IoT Devices, they are always real-time or very close to real-time.
For example, if any device makes an alert so the Administrator or Device Managers should be known immediately because IoT Devices send billions of data per second and there is no time to click on the refresh again and again.
Technologies behind SignalR
SignalR uses four of the most popular technologies used to make real-time Applications.
- Web Sockets
- Event Source
- Forever Frame
- Long Pooling
Now the question is why we are not going to use the above technologies directly instead of SignalR?
Because, if above technologies get a new Feature, for E.g., your application is programmed using the Web Sockets, so you might have to go and change something for adding the updated Functionality but If you are using SignalR, all of the changes and updates are responsibility of the SignalR and it will give you the right results.