System design · interactive
Real-time: polling, SSE and WebSockets
Four chat messages arrive on the server at 3, 4, 19, 42 seconds. How quickly does each reach the browser, and how many requests does that cost over a minute?
0 s60 s
Amber: message arrives at the server. Bar: wait until the browser has it. Lines: polls.
- Avg delay
- 5.5 s
- Requests/min
- 6
- Connection
- new request each poll
- Direction
- separate POSTs
Simple and cache-friendly, but messages wait up to 10 s, and 6 requests a minute per user mostly return nothing.
Transport
Step 1 of 4 · read left to right
In production
Tools and technologies
Real-time services wrap these transports for you.
Not tied to one language — use these names when you search docs or design a system.