Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to Scale Node.js WebSocket Redis Server?
    text
    copied!<p>I'm writing a chat server for <a href="http://www.acani.com" rel="nofollow noreferrer">Acani</a>, and I have some questions about <a href="https://stackoverflow.com/questions/4710420/scaling-node-js">Scaling node.js</a> and <a href="https://stackoverflow.com/questions/8627295/websockets-with-load-balancer-scalability">websockets with load balancer scalability</a>.</p> <ol> <li><p>What exactly does it mean to load balance Node.js? Does that mean there will be <em>n</em> independent versions of my server application running, each on a separate server?</p></li> <li><p>To allow one client to broadcast a message to all the others, I store a set of all the <code>webSocketConnections</code> opened on the server. But, if I have <em>n</em> independent versions of my server application running, each on a separate server, then will I have <em>n</em> different sets of <code>webSocketConnections</code>?</p></li> <li><p>If the answers to 1 &amp; 2 are affirmative, then how do I store a universal set of <code>webSocketConnections</code> (across all servers)? One way I think I could do this is use Redis Pub/Sub and just have every <code>webSocketConnection</code> subscribe to a channel on Redis.</p></li> <li><p>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 <em>m</em> independent versions of Redis running on different servers? Is that even possible?</p></li> <li><p>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?</p></li> </ol> <p>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.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload