Answer the question
In order to leave comments, you need to log in
How to balance and sync chat on nodejs?
Hello!
There is a chat on nodejs + socket.io. I read a couple of articles on the net about this, there are options using cluster, nginx. Actually, everything is clear here, but it is not clear how to synchronize clients from all workers? Let's say 10 people on one worker, and the other part on another, how to send messages to all active clients?
When a client connects, I create an object with some flags and its socket, and add it to the array with all other clients.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question