Pub/sub layer such as Redis or NATS ensures cross-instance message delivery
Why it matters
In-process broadcast with io.to(channel).emit() only reaches clients connected to the same server instance. The moment you deploy two instances — behind a load balancer or via auto-scaling — users on different instances stop receiving each other's messages. This is a latent failure: the app works perfectly in development and single-instance staging, then silently breaks in production the first time the process count exceeds one. ISO 25010 reliability requires the system to function correctly under expected deployment configurations, including horizontal scaling.
Severity rationale
High because in-process-only broadcast silently partitions users across server instances, causing message loss that is invisible in single-instance testing.
Remediation
Route all broadcasts through a shared pub/sub layer — Redis is the standard choice for Socket.IO via the @socket.io/redis-adapter package.
import { createAdapter } from '@socket.io/redis-adapter';
import { createClient } from 'redis';
const pub = createClient();
const sub = pub.duplicate();
await Promise.all([pub.connect(), sub.connect()]);
io.adapter(createAdapter(pub, sub));
// io.to(channel).emit() now fans out across all instances
Alternatively, use NATS or Kafka if your infrastructure already includes them. The skip condition applies only when the deployment is permanently single-process — document that constraint explicitly if you take the skip.
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the Real-Time Communication Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- iso-25010:2011 · reliability.availability — Availability — cross-instance pub/sub preserves message delivery under horizontal scaling
Taxons
History
- 2026-04-18·v1.0.0·Initial import from community-realtime·automated