I'm writing a chat server for Acani, and I have some questions about Scaling node.js and websockets with load balancer scalability.
What exactly does it mean to load balance Node.js? Does that mean there will be n independent versions of my server application running, each on a separate server?
To allow one client to broadcast a message to all the others, I store a set of all the
webSocketConnections
opened on the server. But, if I have n independent versions of my server application running, each on a separate server, then will I have n different sets ofwebSocketConnections
?If the answers to 1 & 2 are affirmative, then how do I store a universal set of
webSocketConnections
(across all servers)? One way I think I could do this is use Redis Pub/Sub and just have everywebSocketConnection
subscribe to a channel on Redis.But, then, won't the single Redis server become the bottleneck? How would I then scale Redis? What does it even mean to scale Redis? Does that mean I have m independent versions of Redis running on different servers? Is that even possible?
I heard Redis doesn't scale. Why would someone say that. What does that mean? If that's true, is there a better solution to for pub/sub and/or storing a list of all broadcasted messages?
Note: If your answer is that Acani would never have to scale, even if each of all seven billion people (and growing) on Earth were to broadcast a message every second to everyone else on earth, then please give a valid explanation.