Design Nearby Places
MediumSystem design · Geospatial Search
Design a nearby-places search like Yelp or Google Maps 'near me'. Users send a location, radius, and optional filters (category, open now, price) and get a ranked, paginated list of businesses. Place data (add, edit, close) changes over days, not seconds. Out of scope: live moving locations such as friends on a map (see the location sharing problem), routing, and reviews content.
Requirements
- Support radius queries with category and attribute filters
- Choose and justify a geospatial index (geohash, S2/H3 cells, quadtree) and handle cell boundaries and uneven density
- Rank by distance combined with rating, popularity and relevance, and expand the radius when results are sparse
- Handle hot city centres, caching, pagination, and place updates