SSE, Websocket, Socket.io And Redis

More notes on SSE - https://whoop.ankitwww.com/board/sd-general-client-communication

General idea for scaling SSE with Redis:

In other words:

You store each event in Redis under its topic (usually one stream per topic), and when a client connects to any SSE server:

  1. They include Last-Event-ID (and the topic they want).

  2. The server reads from that ID onward in Redis for that topic.

  3. The server streams all missed events first, then stays subscribed for new ones.

That way:

Formation notes - https://drive.google.com/file/d/1nHHX6wFLovt0dq9NEvtLFoij35o7mvF6/view?usp=sharing

It’s built on top of WebSockets but is more than just WebSockets — it adds:

Pasted image 20250131230055.png