Grokking Modern API Design Interview
Vote

0% completed

Real Time Delivery: WebSockets, SSE, and Long Polling

An order-status page needs to learn when an order moves from confirmed to shipped.

The simplest answer is polling GET /orders/ord_7M2K every three seconds. One open page then makes 20 calls a minute, 1,200 an hour, and 28,800 a day. Almost all of them say nothing changed, and the one change that matters can still arrive nearly three seconds late.

Polling is not wrong. It is expensive when changes are rare, and wasteful when many clients are open at once. This lesson compares the three alternatives, and spends most of its time on what happens when their connection drops.

.....

.....

.....

Like the course? Get enrolled and start learning!