Digital Transformation & Software Engineering Services
Advance Web based Real-Time Business Applications with SignalR

Advance Web based Real-Time Business Applications with SignalR

In today’s digital era, end users have become more demanding with business applications to have real-time updates. This challenges our competitiveness and usually leads us into more complex architectures and tool sets to satisfy new business needs.

Here I’ll be discussing about how SignalR can be used to build real-time web based business applications at a sneak peak level. SignalR is an abstraction over the transports (HTTP) and that would be new WebSocket transport.

WebSocket is a very powerful and efficient system for sending messages between web browsers and servers.

SignalR eases the development by opening persistent connections between browser and server side implementation with just few lines code. Some of you might say that this can be achieved even without using SignalR, with socket programming using WebSockets. I would say that’s true but I can assure you that it could get seriously complex with WebSockets.

Apart from complex coding, another problem with WebSocket is that it needs accessibility at both the ends (Browser & Server) to establish a connection; and there can be many scenarios where network security configurations or firewall may block the websocket connections.

Again SignalR comes here as a rescuer by using very interesting failover mechanism to switch to other transports where websocket is not available.

Overall, SignalR allows server-to-client push and RPC (from server side we can trigger client side script function i.e. Java Script/JQuery and other way round).

SignalR can be used to broadcast to everyone, or target specific clients or client groups. By using SignalR, developers can take advantage of our events on the server side to trigger client side UI or non UI interactions, instead of task/async based implementations that we use today.

Below figure shows traditional task/async based approach v/s new school way with SignalR.

It’s a powerful combination of SignalR and ASP.Net MVC that enables us to build the real-time interacting web based business applications with ease, rather than going into complex coding and architecture development to achieve the same.

SignalR offers two ways for a server and a client to communicate:

Connections: The low-level Connections API uses a Messaging model, in which individual messages are sent between clients and servers, which are then processed and acted upon. The Connections API will be familiar to developers who have used messaging APIs like DirectPlay.

Hubs: The high-level Hubs API uses a Marshalling model, in which servers and clients call methods on each other directly using proxies and endpoints. The Hubs API will be familiar to developers who have used remote method invocation systems like .NET Remoting.

So if you get a real-time processing requirement with web based application, don’t hesitate to explore SignalR along with ASP.Net MVC. The future is great!

Application of SignalR in real-time business apps is limitless. To name a few:

  • Real-time online trading system – instead of client pull, the server pushes the updates to connected clients with updated information about specific trade or overall market position
  • Real-time online ticketing system – reservations can display real-time updates to the clients
  • Real-time appointment booking – scheduler displays real-time updates of appointments booked from numerous terminals

For more details and examples please visit http://www.asp.net/signalr

Happy Coding!

About the Author

Ganesh Gupta Ganesh Gupta
Ganesh is a Technical Architect with Ness Mumbai and has over 15 years’ experience in enterprise level business application development. He has worked as a Tech Architect, Tech Lead, Project Lead, Team Lead and Developer using Microsoft Technologies.

Leave a Reply

CLOSE

CLOSE

CLOSE

CLOSE

CLOSE

CLOSE

CLOSE

CLOSE