Polling, long polling, SSE and WebSockets

Polling asks repeatedly, long polling holds the request until there is news, Server-Sent Events stream updates one way, and WebSockets keep a two-way connection open. Real-time chat needs persistent connections, which are stateful to scale.

Where it shows up in real systems

  • Real-time gateway

    Chat, live scores and collaborative editing need the server to talk first. Persistent connections are stateful: each user is pinned to one gateway node, so a node failure forces reconnections and a presence store is needed to know who is online where.

    In production: AWS API Gateway WebSocket, Socket.IO, Phoenix Channels, Centrifugo, Pusher, Ably

See it break, then fix it

Build an architecture, send it a day of traffic and outages, and learn why it holds or fails. Free to start.