I\'d like to know if it\'s possible to broadcast on different websocket \"connections\" running from the same node-websocket-server app instance. Imagine a chatroom server w
Shripad K's answer is very well structured. Good job.
I think that solution will have some scaling issues though.
If you had 10,000 concurrent users in 500 chat rooms, then every time any user sent a message, you'd have to loop through all 10,000 clients. I suspect that it would be faster to store the list of clients in a given room in a structure in redis and just grab this list and send to those clients.
1) Not sure if that's actually faster. 2) Not sure what could be stored in redis that would then allow us to reference clients. Maybe there could be a hash of all clients in the server, by a unique id and in redis, we could just store a set of the user id's per chat room?
Does this seem any more scalable?
I've written a node chat server based on fzysqr's and need to make it scalable for multiple chats before we roll it out widely.