Real-Time Communication

Moving beyond request/response — persistent connections, streaming, and the patterns that power live experiences.

Polling

ClientServerGET /updates
1/8Client sends request — any new data?

Long Polling

Short Polling

WebSockets

WebSocketconnecting...
ClientServerGET /ws (Upgrade)
1/12Client sends HTTP upgrade request to establish WebSocket

Persistent Connections

Full Duplex

Connection Management

Scaling Challenges

Sticky Sessions

Pub/Sub Layer

Use Cases

Server-Sent Events (SSE)

Server-Sent Eventsidle
ClientServerGET /events (Accept: text/event-stream)
1/12Client sends GET request with Accept: text/event-stream

One-Way Stream

Simpler Than WebSockets

When to Use It