Urgent.News

What's breaking now, across thousands of outlets.

More in Tech

Scaling Real-Time Stream Chat in Go: In-Memory Hubs, WebSockets, and Redis Pub/Sub

Live stream chat is deceptively hard. What starts as "just broadcast messages to connected clients" becomes a distributed systems problem the moment you scale past a single server instance.

  • In-memory WebSocket hub per process for local speed and efficiency
  • Redis Pub/Sub for cross-instance fan-out and horizontal scalability
  • Each instance maintains client map with single goroutine to avoid data races

More from Tuesday 27 October →