Socket.IO without duplicates in a multi-worker setup: how we tamed realtime
In PDP Mobile, the residents’ chat with the management company has to work here and now — without duplicates or magic. Here’s how we set up Socket.IO with a Redis adapter to synchronize across workers.

In PDP Mobile, our residents’ chat with the management company has to work here and now: messages, attachments, all without the magical “oh, it sent twice.” When the backend runs on multiple instances, this is the classic distributed systems pain point — especially now, when horizontal scaling is a baseline, not a “someday” thing.
What we did: we set up Socket.IO with a Redis adapter so events are synchronized between workers and delivery happens exactly once. As a result, realtime doesn’t fall apart even if a user lands on a different instance.
A few practical details: — the chat supports attachments; — for Safari, we added a special workaround: the token is passed in headers, not through a cookie; — on reconnect, we enabled exponential backoff — up to 5 attempts.
In short: less “why is the chat silent?” and more solid UX. Redis here really is like the team lead on a call: it synced everyone up and kept the chaos from breaking out 😄