200 million businesses, and the search index fits on one server
transcript
Assume 200 million businesses. 15,000 nearby searches a second. And the index that finds them fits on one ordinary server.
Each business record, name, hours, rating, is about a kilobyte. 200 gigabytes. But the index only needs an ID, a location and a cell. About 32 bytes. Add overhead. Call it 10 gigabytes. That's the most important number here.
10 gigabytes fits in one server's memory. And it changes about once a second. So don't shard it. Give every search host a full copy.
Any host answers any search. No scatter-gather, no cross-shard queries. Need more throughput? Add hosts. A set in every region, near users. Owners edit in PostgreSQL. A change stream updates every copy within minutes. And a nightly rebuild replaces each copy in turn. A missed event lasts a day, at worst.
Now the twist. The business database goes down at peak. Searches keep working. The index and the details cache are in memory. Only owner edits fail, until it's back. Isolated on purpose.
Full copies only work because the index is about 10 gigabytes. Say that number early. The whole design follows.
Full breakdown in the lecture.