SYSTEM DESIGN SKETCHBOOK / PRACTICE SHEET / NO. 16
Design a nearby places search
People open a local discovery app and look for coffee, a pharmacy or dinner near where they stand, or around a pin they dropped on the map. They expect a ranked list of places within walking or driving distance and a map that fills in as they pan.
Requirements
- Return places within a radius of a point (500 m to 25 km), optionally filtered by category and open now, ranked by a mix of distance and rating.
- Return places inside the rectangle currently visible on the map.
- Let business owners add or edit a place (name, location, category, hours); edits show up in search within 10 minutes.
- Show a place detail page with address, hours and a rating summary.
Constraints and assumptions
- 200 million places worldwide; about 100,000 places added or edited per day.
- 100 million daily active users making about 5 searches each; peak traffic is 3× the daily average.
- Search p99 under 200 ms at the server; return the top 50 results.
- Density varies wildly: a downtown block can have 2,000 places within 500 m, while a rural search may find nothing within 20 km.
Out of scope for the first sketch
Writing reviews and uploading photos · Directions and routing · Ads in results · Full-text relevance beyond category and name prefix
Draw your design
Rough math and notes
SYSTEM DESIGN SKETCHBOOK / FOLLOW-UPS
Design a nearby places search
Finish your first sketch before answering these. Cross out freely.
- A downtown query matches 40,000 candidates while a rural one matches 3. How does your index adapt to density?
- The search circle crosses a cell boundary, or the antimeridian. How do you make sure places just across the line are not missed?
- A business changes its hours or moves across the street. How long until search reflects it, and what exactly gets updated?
- Product adds nearby friends: show which friends are within 5 km, with locations updating every 30 seconds. What changes in your design?
Compare afterwards: worked approaches and reading at sketchbook /questions/nearby-search/review