Grokking Modern API Design Interview
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 can be a reasonable choice when a short delay is acceptable. However, frequent polling creates many requests that return unchanged data. This lesson compares three alternatives and explains recovery after a connection drops.
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%