I was looking for the same thing to develop a scaling-ready web application, and apparently there is not much discussion about this article.
Case 1 The recommended approach is to use the Redis cache, for example Heroku , use the service bus or store in db, like the 3 approaches mentioned in Scaleout in SignalR . However, there is a trick, there should be a little latency , because in order for the second instance to want to know, the scheduler or desktop / desktop service must be executed continuously to detect new changes in the cache / queue / db .
Case 2 In my case, I want a high frequency almost in real time . Therefore, it must have a permanent connection between instances. However, the challenge is, we cannot do this between a stateless web server.
Thus, we still need an intermediate multi-year background / working service and implement our own net / socket / TCP code from the code and maintain the connection pool, but this is not an easy task.
Iβm thinking about using the Websocket client on the server (for this service), so the pattern for communicating with the client and between instances is almost the same. See this: 1 2 . It remains only to update the IP address of the instance in a distributed cache or db on each instance up / down.
The last option is to explore the new WebRTC
source share