In my previous posts, here and here, I discussed my objective to create a custom dashboard solution in order to meet a number of requirements as well as a method for creating that solution using a traditional Web Services approach. In this approach, the client is wholly responsible for requesting all of its updates from the server whenever it needs them (typically on a set timer). In this post, I’ll create the same dashboard but use a different technology, SignalR, for performing the data communications. Much of the solution will be the same or similar to the previous solution, however the back-end is fundamentally different.
With the SignalR approach, rather than the client being responsible for requesting data updates from the server, the server maintains a connection with the client and pushes them to the client on an “as needed” basis. This basis can be timed (such as sending an update once every 5 minutes) or it can be triggered (such as sending an update whenever data changes.) In this example, we’ll be using the timed approach for parity with the previous solution. As an extra benefit to the SignalR solution, when multiple clients are connected to the same dashboard, they will all display the exact same data and refresh at the exact same time (as they are not maintaining their own individual update timers. The following diagram gives a quick illustration of the data communications between the clients, web server, and database server: