System Design · Senior · Question 11 of 75

How do you scale WebSocket servers horizontally?

Explanation

Users of the same chat are connected to different nodes. The node that receives a message publishes it to a bus, and nodes with subscribers deliver it to their connections. The load balancer must support long-lived connections; during deploys clients reconnect gradually.

Further reading

Problem with a question

System Design · Senior · question 11

Test yourself

Take the System Design · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz