75,000 location pings a second. Only 1 in 45 matters.
transcript
300,000 delivery riders online at the evening peak. Every phone pings every 4 seconds. That's 75,000 location writes a second.
Launch night, they went straight into product search. 10,000 a second, in one city. p99 went from 120 to 900 milliseconds. Every ping rewrote a whole search document.
But here's the catch. Most pings change nothing. A rider does about 15 kilometres an hour. That's 17 metres a ping.
Map the city in hexagons. A path crosses one in about 0.73 kilometres. That's about 175 seconds of riding. So only about 1 ping in 45 changes cell.
So keep positions in memory. Each ping asks one question. Same cell? Just overwrite the position. Cheap. New cell? Only then touch the cell index.
75,000 cheap overwrites a second. Only about 1,700 index moves. 98 percent of pings never touch the index. They just overwrite a position.
Write every ping. Index only the moves. Design for 1,700, not 75,000.
Full breakdown in the lecture.