400,000 people watching their food: why live tracking is pushed, not polled
transcript
Dinner rush. 400,000 people watching their food on a map. Every 10 seconds, each app asks: anything new? 40,000 questions a second. Almost every answer: nothing new.
Polling burns 40,000 reads a second. To say nothing changed. So flip it. Each tracking screen holds one live connection. The server pushes when something actually moves.
Customers, drivers, restaurant tablets. About 600,000 connections. At 200,000 a node, with a spare zone: about 5 gateways. Lose a zone? 200,000 reconnect, in about a minute.
Driver location? Only the newest point matters. Miss one, and the next arrives in about 4 seconds. Order status is different. Picked up must never be skipped.
But here's the catch. The phone jumps from Wi-Fi to 4G. The socket dies. Nobody tells the server. The app reconnects and says: resume after sequence 3. Missed status first. Then the next point, 4 seconds later.
Don't let 400,000 phones ask. Tell them. Then size it by connections, not requests.
Full breakdown in the lecture.