Building Lightweight WebSocket Relays for Real-Time Device Telemetry & Queue Updates

Nikila Udana • INTTECH Core Systems — September 2026

Comparing HTTP polling against persistent binary/JSON WebSocket channels for live waiting-room displays and remote server monitoring.

1. Eliminating Polling Overhead

Repeated HTTP polling every two seconds generates redundant TLS handshakes, header parsing overhead, and database load. Maintaining persistent WebSocket connections reduces per-update bandwidth to a few dozen bytes while delivering sub-100ms UI updates.

2. Heartbeat Keepalives & Automatic Reconnection

Mobile networks and NAT routers frequently drop idle TCP sockets. Implementing 25-second ping/pong heartbeats paired with exponential backoff reconnection logic ensures waiting-room screens and mobile dashboards recover seamlessly from brief connectivity drops.

3. Topic-Based Room Broadcasting

Grouping connected clients into isolated channel rooms ensures that token status updates for a specific clinic or server node are broadcast exclusively to authorized subscribers.