0

Relay Hybrid Connections is one of the options to grant access to a RESTful web services hidden behind a firewall. I was wondering how the load balancing would work. There are multiple stateless instances of this web service:

  • Would each of them register with the Relay service?
  • Would I then have one Relay endpoint and many listeners behind it?
  • How would the Relay service load balance?

Thanks in advance

Helikaon
  • 1,490
  • 13
  • 30

1 Answers1

1

Would each of them register with the Relay service?

Would I then have one Relay endpoint and many listeners behind it?

Per my understanding, since your web service is running under multiple stateless instances, you could construct the HybridConnectionListener instance on each of your web service instances for a better performance. As this official tutorial states about Listener interactions:

The Hybrid Connections service endpoint allows up to 25 concurrent listeners on a Hybrid Connection.

How would the Relay service load balance?

As the Interaction model mentioned about Listener interactions:

If there are 2 or more active listeners, incoming connections will be balanced across them in random order; fair distribution is not guaranteed.

Bruce Chen
  • 18,207
  • 2
  • 21
  • 35
  • How would you then support a scenario where a set of connections that all need to communicate together but are load balanced to different listeners? For a simpleexample, a chat application with 2 users, 2 listeners, each user connected (via load balancing) to a different listener? If UserA sent a message to listenerA, the connection serviced by listenerA would have no idea how to send a message to userB... I've seen this solved with a backplane (think signalR), but that has its own set of problems. Is relay not a good choice for supporting a scenario like this in a scale-out paradigm? – pseabury Aug 04 '17 at 15:29