0

Given an Azure hosted Web Role with a highly-available WebAPI (say 99.95%, as per https://azure.microsoft.com/en-us/documentation/articles/resiliency-disaster-recovery-high-availability-azure-applications/) application that has ~1000 clients. Client is a ReactJS application. The WebAPI application will push notifications tailored to specific client groups (e.g. not all client users are interested in all events, but >1 user may be interested in the same event).

From reading the SignalR documentation and playing with some samples it feels like SignalR Groups will help us flow the right events to the right ReactJS application instances. Additionally we would use one of the SignalR scale out providers to make sure that the we push to the clients from the right WebAPI server instance.

Question: How do applications recover when the "right WebAPI" instance becomes unavailable?

I can imagine a server-side active/passive scheme with some complexity around making sure there is at least one 'server' for each Hub Client...but can a Server connect (in an unsolicited way) to a Hub Client? Would we have each Hub Client connect (when registering for a Group) to >1 Server?

How have applications solved this issue with SignalR?

Howard Hoffman
  • 897
  • 1
  • 9
  • 22

1 Answers1

1

I think I missed the obvious point that the scale-out providers and the back plane provide the very protection that clients need against servers that go-away. Clients don't connect to a specific server, but to a load-balanced name.

Howard Hoffman
  • 897
  • 1
  • 9
  • 22
  • My original question still stands; my above answer is not right. My reading of the documentation is that the scale-out back plane will let all Web servers know about all Clients. However it is not clear how Groups play with that. Assume 2 Web Machines, `WebA` and `WebB`, 2 Clients `ClientA` and `ClientB`, with 2 Groups, `GroupA` and `GroupB`. If `ClientA` connects to `WebA` and joins `GroupA`, can `WebB` call an API on `ClientA`? My thinking is only WebA can call APIs on ClientA. Is this correct? – Howard Hoffman Oct 27 '16 at 13:35
  • I found that Groups work well with the scale-out back-plane; no custom code needed. Using ServiceBus with Groups, confirmed with 2 instances of IISExpress hosting a WebAPI application (OWIN) that each application was able to send traffic to just the proper groups. Also that a `ThreadPool.QueueWorkItem` worker able to send traffic to clients in Groups that had connected to both web servers. What threw me was some comments in @DamianEdwards 2013 presentation (https://channel9.msdn.com/Events/Build/2013/3-502), leading me to think I needed a custom solution. None needed. – Howard Hoffman Oct 31 '16 at 12:49