Grokking the Modern Frontend System Design Interview
Vote

0% completed

​

Polling Server Sent Events and WebSockets

Suppose 20,000 Basket orders are out for delivery during the busiest hour, and each tracking page asks the server every 5 seconds whether anything has changed. That is 20,000 / 5 = 4,000 requests per second for as long as the peak lasts.

Suppose a 40-minute order changes status 6 times: confirmed, picking, packed, out for delivery, arriving, delivered. Its page sends 40 x 60 / 5 = 480 requests, so 474 of the 480 answers say that nothing is new. Even the useful answers arrive late, up to 5 seconds after the change.

The alternative is to let the server send the change when it happens

.....

.....

.....

Like the course? Get enrolled and start learning!

Reading Progress

0%


Vote for new content