Location & mobility · Beginner
Nearby places search
Yelp-style read-heavy geo search over geohash cells, with ratings rolled up in the background.
Every part, and why it is there
Users
People search nearby far more than they write reviews, roughly hundreds of reads per write. The design leans hard toward fast reads.
CDN
Business photos are the heaviest part of a results page; the CDN serves them close to the user.
Photos
Uploaded photos, stored once and served through the CDN.
Load balancer
Spreads search, business-page and review traffic across stateless servers.
Nearby search
Turns “lat, lng, 2 km, open now, sushi” into a lookup of the user’s geohash cell plus its neighbours, then filters and sorts by distance and rating.
Hot-area cache
Busy places like downtown get the same searches all day. Caching results per cell and category avoids repeating identical geo queries.
Geo index (geohash)
Businesses indexed by geohash, a string where nearby places share a prefix. “Near me” becomes “same prefix or a neighbouring prefix”, which any index can answer quickly.
Business service
Serves a business page and handles owner edits. Businesses rarely move, so the geo index can be updated lazily.
Businesses DB
Source of truth for business details, hours and the precomputed average rating. Read replicas carry the page-view load.
Review service
POST /businesses/:id/reviews accepts a new review. It does not recompute the average rating inline, which would turn every review into a hot write on a popular business.
Reviews store
Reviews are append-mostly and read per business, a natural fit for a document store partitioned by business id.
Index updates
New reviews and business edits drop a message here, so rating maths and index refreshes happen in the background.
Rating aggregator
Recomputes the average rating and review count, writes them to the business record and refreshes the geo index so search can sort by rating.
Asked in interviews at
- meta
- openai
- yelp
- twilio
- apple
- amazon
Concepts used here
- Geohash: Build a short code like xn76fg for any spot on Earth, so “ramen near me” becomes “codes that start with xn76fg”, one read on an ordinary database index.
Learn more
- FAANG System Design Interview: Design A Location Based Service (Yelp, Google Places) (ByteByteGo)
- Proximity Search & Geospatial Indexes Explained (Hello Interview)
- System Design Mock Interview: Design Yelp w/ Meta Staff Engineer (Hello Interview)
- Design Yelp (Hello Interview)
- Proximity service (ByteByteGo)
- Redis geospatial (Redis)