Broadcast or publish / subscribe to update thousands of users

I have a client / server application that must constantly update each user application with a set of status information.

As a rule, up to 1000 concurrent users may be up to a thousand, but in the future this may increase to 5000.

Updates should be provided approximately every 10 seconds so that the user view of the application is never out of date.

What would be the best approach (this is a .NET C # application)?

  • A broadcasting mechanism in which each client listens for an update message
  • A publish / subscribe mechanism in which each connected client tells the server to send a message to it every 10 seconds.
  • Client request - every 10 seconds each client requests current data

The system I inherited uses the latter approach - and does not scale to the required degree.

thank

+3
source share
3 answers

I would recommend using an architecture that implements something along the lines of NodeJS or in the .NET arena, something like SignalR (there are other pop-ups, see the project here

https://github.com/SignalR

and demo

http://chatapp.apphb.com

+1
source

Take a look at the observer pattern .

Thus, only customers who are interested will listen, and the publisher will not be "DDoS`ed."

0
source

Focusing only on the approach, I recommend multicast. At startup, the client must register for the multicast group, and then the server sends a packet to this multicast group. This way you can reduce broadcast overhead. Secondly, you can seriously think about threads in your scenario. Handling thousands of clients with a single thread may not be the smart solution.

You can reference this draft code article as an example for multicast

0
source

All Articles