Your dashboard needs live updates, your build pipeline needs progress streams, and your users want to know when something happens without refreshing the page. Here is how to build it with Server-Sent Events: 30 lines of server code, the EventSource API on the client, and Redis pub/sub so it actually scales past one server instance.
Your WebSocket reconnects instantly on every disconnect, hammers the server during restarts, and silently drops messages the client never knew it missed. Here is the exponential backoff, jitter, and event-synchronization pattern that turns a brittle socket into a resilient real-time feed.
Most teams reach for Redis pub/sub or a message broker before their actual traffic warrants it. Postgres has had pub/sub built in since 2010. Here is the working pattern, the limits to watch, and how to migrate to a real broker once you outgrow it.
Server-sent events are a 1.5KB drop-in for streaming notifications, progress, and live updates, and they work through every proxy and CDN that already handles HTTP. WebSockets are the right tool for genuine bidirectional, low-latency traffic. Here is the decision tree and the implementation patterns for each.