Performance: Rooms and namespaces
MEDIUM IMPACT
This concept affects real-time communication performance by controlling message routing and reducing unnecessary network traffic.
io.to('room1').emit('message', data);
io.emit('message', data);| Pattern | Network Traffic | Client Processing | Event Handling | Verdict |
|---|---|---|---|---|
| Broadcast to all clients | High | High | High | [X] Bad |
| Emit to specific room | Low | Low | Medium | [OK] Good |
| Single namespace for all events | Medium | Medium | High | [!] OK |
| Separate namespaces per module | Low | Low | Low | [OK] Good |