ASP.NET SignalR is Amazing: Read Or Miss Out

ASP.NET SignalR

Howdy Readers,
A warm welcome to my blog ! Today we will be focusing on the guy who is Microsoft’s powerful and real-time communication technology – SignalR !

ASP.NET SignalR is a new library for ASP.NET developers that makes developing real-time web functionality easy. SignalR allows bi-directional communication between server and client. Servers can now push content to connected clients instantly as it becomes available. SignalR supports Web Sockets, and falls back to other compatible techniques for older browsers. SignalR includes APIs for connection management (for instance, connect and disconnect events), grouping connections, and authorization.

In simple terms,
SignalR is real-time, persistent connection abstraction over HTTP for .NET Click To Tweet

Is SignalR only used for chat applications ?

No.Not at all. It can be used for many other types of applications as well. Below are few of them:

ASP.NET SignalR

ASP.NET SignalR

  • Dashboard & Monitoring
  • Collaborative anything
  • Job progress
  • Real time forms
  • Gaming

3 Main principles of SignalR ?

  1. Simplicity
  2. Reach
  3. Performance

Let’s cover these topics in some more details.

SIMPLICITY

SignalR used two level APIs. These are Connections & Hubs. Click To Tweet
ASP.NET SignalR Real-time

ASP.NET SignalR Real-time

Connections:

  • Low level
  • Raw strings up and down
  • Broadcast to all clients, groups or individuals
  • Connect, reconnect & disconnect semantics

Hubs:

  • High level
  • Built on top of connections
  • RPC (Remote Procedure Call) from client-server AND server-client
  • Automatic client proxy generation (JavaScript – <script src=“~/signalr/hubs”></script>)

REACH

Web sockets works if …

  • You use ASP.NET on windows server 2012
  • Client used IE10 or latest chrome, Firefox, Safari browsers
  • Your load balancer/reverse proxy supports it
  • Client proxy server/NAT supports it
  • You are happy coding against raw sockets
  • You manage scale-out yourself

On the other hand …

  • SignalR works everywhere
  • SignalR try Web Sockets the fallback to –
    • Server Sent Events
    • Forever Frame
    • Long Polling
  • It gives a simple and powerful API to work with
  • SignalR does its best to keep the logical connection up, including retry logic if transport fails
  • It scale-out to web-farms

PERFORMANCE

Performance for SingnalR is measured by parameters such as throughput & scale. Click To Tweet

Throughput

  • Very high performance in a single box
  • 100,000’s of messages per second
  • Very low memory overhead

Scale

  • Fully async to optimize resource utilization
  • 1,000’s of connections per server
  • Supports horizontal scale-out using a pluggable message bus backplane (Service Bus, Redis, SQL)

REFERENCES

That’s all for now. We will be back with some real examples and scenarios related to SignalR. Meanwhile, you can check out some of our ASP.NET & HTML 5 articles.

What do you Think ?

Dear Reader,
If you have any questions or suggestions please feel free to email us or put your thoughts as comments below. We would love to hear from you. If you found this post or article useful then please share along with your friends and help them to learn.

Happy Learning 🙂