A single WebSocket server inevitably hits a hard wall when concurrent connections and message volume climb. In a distributed topology, in-memory socket state remains strictly confined to the instance holding the active TCP connection. A message emitted into Node A stays trapped in Node A; users connected to Node B and Node C never receive the broadcast.
To resolve this partition, the subject engineered a horizontally scalable backbone centered on Redis Pub/Sub. When a client transmits an event to its connected Socket.IO instance, the server publishes the payload immediately across the shared message broker. Sibling instances subscribed to the channel receive the transmission and deliver it down to their own locally connected clients in near-real-time.
“In-memory socket state is local to each instance — without Redis, half the room is deaf to the other.”
The infrastructure is packaged with Docker Compose, deploying three independent Node.js / Express backend instances behind an Nginx reverse proxy. Core engineering covers cross-instance message routing, cluster-wide typing indicators, and shared presence tracking where heartbeats expire unceremoniously if an instance drops offline.
Verification notes on file document target benchmarks: sustaining 500 to 1,000 concurrent connections, 50 to 100 messages per second, and a p95 latency under 500 milliseconds. The investigation desk records these as architectural targets under ongoing testing, rather than confirmed lab measurements.