In the last chapter we found restaurants near you. This one looks almost identical — find friends near you — and it is a completely different problem.
Restaurants do not move. A restaurant’s location is written once and read a billion times, which is why that design could precompute an index, cache it globally, and rebuild it overnight.
People move. Every user is emitting a new location every thirty seconds, and every one of those updates has to reach a few hundred other people right now. The index is obsolete before you finish building it.
Continue reading »
