2

Environment: .NET framework 4.8 backend. SignalR is used for some of the messaging.

Problem: The application is running on a single server and needs to be scaled out. Having a single point of failure is also extremely bad for the availability. Higher performance and availability are required.

Possible solution: Use Redis backplane. This allows multiple servers to sub/pub to the Redis backplane allowing horizontal scaling at least in this way.

Problem with the solution: Correct me if I'm wrong: If all the servers are reliable on the single Redis backplane, the problem of single point of failure still exists. Also, the single backplane's performance might run out in the future.

Questions: How does the Redis backplane scale out then? How can I work with multiple backplanes and ensure that their data stays synchronized?

https://learn.microsoft.com/en-us/aspnet/core/signalr/redis-backplane "Redis Clustering is a method for achieving high availability by using multiple Redis servers. Clustering isn't officially supported, but it might work."

https://learn.microsoft.com/en-us/aspnet/signalr/overview/performance/scaleout-with-redis "SignalR scaleout with Redis does not support Redis clusters."

Are there some hard problems with the usage of SignalR together with multiple Redis backplanes? If this is a poor idea, what other options are available to replace either Redis or SignalR?

OvalOlive
  • 115
  • 1
  • 8

1 Answers1

0

SignalR for .NET Framework is now depreciated. If you want to "futureproof" you solution, I suggest switching to SignalR for .NET Core. Core also support Azure backplane but no longer support SQL backplane.

One way to do what you want would be for each server to monitor if the Redis backplane is us and to switch to another if it is not. In my implementation, each SignalR server sends messages to other servers over the backplane so they know how many servers are on the backplane and that the backplane is working.

eglease
  • 2,445
  • 11
  • 18
  • 28
  • 1
    It sounds like a high availability setup is manageable with the Redis backplane. How about the performance of the Redis backplane, can it be scaled horizontally? Is there documentation on how much traffic can a single backplane handle? For example, is the capacity per second in the hundreds of thousands or millions of messages? – OvalOlive Dec 04 '22 at 19:16
  • 1
    Performance would depend on a lot of factors like message sizes, number of clients, number of messages, etc. Be aware that both myself and others ran into strange issues where the message throughput in Redis just kept growing over time with no explanation. I think this is a bug in SignalR. See https://stackoverflow.com/questions/68642118/asp-net-signalr-with-redis-scaleout-backplane-causes-linear-increase-in-server-l – eglease Dec 05 '22 at 14:11