Information about SignalR 2.0
I this blog we will explain the SignalR Scaleout features. Scaleout means
adding more servers to handle the load of multiple clients.
Why need to implement SignalR scaleout?
An application that uses SignalR needs to keep track of all its connections, which creates problems for a server farm. Add a server, and it gets new connections that the other servers don’t know about. For example, SignalR on each server in the following diagram is unaware of the connections on the other servers. When SignalR on one of the servers wants to send a message to all clients, the message only goes to the clients connected to that server.
Clients can get routed to different servers. A client that is connected to one server will not receive messages which was sent from another server.
Here solution is forward messages between servers, using a component called a backplane. each application instance sends messages to the backplane, and the backplane forwards them to the other application instances. a SignalR backplane connects multiple servers.
Backplane
When a client makes a connection, the connection information is passed to the backplane. When a server wants to send a message to all clients, it sends to the backplane. The backplane knows all connected clients and which servers they’re on. It sends the message to all clients via their respective servers. This process is illustrated in the following diagram:
SignalR currently provides three backplanes:
- Azure Service Bus: Service Bus is a messaging infrastructure that allows components to send messages in a loosely coupled way.
- Redis: Redis is an in-memory key-value store. Redis supports a publish/subscribe (“pub/sub”) pattern for sending messages.
- SQL Server: The SQL Server backplane writes messages to SQL tables. The backplane uses Service Broker for efficient messaging.
<p>
In conclusion, the introduction of Scaleout in SignalR Version 2.0 has
revolutionized real-time web applications by providing efficient and
scalable solutions. As we explored in this blog, Scaleout allows
applications to handle high volumes of concurrent connections, distribute
messages across multiple servers, and maintain a synchronized state across
the server cluster.
</p>