Skip to content

Yelp / Nearby Places — Detailed#

flowchart TB
  subgraph Clients
    APP[App]
    WEB
  end

  subgraph Edge
    CDN
    GW
  end

  subgraph Places
    PSVC[Place Service]
    PDB[(Places SQL)]
    IMG[Photos / S3]
    HOURS[Hours / Status]
  end

  subgraph Geo
    GIDX[(Geo index<br/>quadtree / geohash / S2)]
    NEAR[Nearby query]
    BBOX[Bounding box]
    KNN[k-NN search]
  end

  subgraph Search
    SRCH[Search Service]
    INV[(Inverted index<br/>name + category + amenities)]
    RANK([Relevance ranker<br/>distance + ratings + popularity])
    AUTOC[Autocomplete]
  end

  subgraph Reviews
    RSVC[Review Service]
    RDB[(Reviews)]
    PHOTO[Photo Service]
    SPAM([Spam classifier])
    MOD[Moderation]
    AGG([Rating aggregator<br/>Bayesian average])
  end

  subgraph Engage
    CHECK[Check-in]
    BOOK[Reservation integration]
    NOTIF[Notifications]
  end

  Clients --> CDN --> GW
  GW --> Places
  GW --> Search --> Geo
  Search --> INV
  Search --> RANK
  GW --> Reviews
  Reviews --> SPAM --> MOD --> RDB
  Reviews --> AGG --> PDB
  GW --> Engage

    classDef client fill:#dbeafe,stroke:#1e40af,stroke-width:1px,color:#0f172a;
    classDef edge fill:#cffafe,stroke:#0e7490,stroke-width:1px,color:#0f172a;
    classDef service fill:#fef3c7,stroke:#92400e,stroke-width:1px,color:#0f172a;
    classDef datastore fill:#fee2e2,stroke:#991b1b,stroke-width:1px,color:#0f172a;
    classDef cache fill:#fed7aa,stroke:#9a3412,stroke-width:1px,color:#0f172a;
    classDef queue fill:#ede9fe,stroke:#5b21b6,stroke-width:1px,color:#0f172a;
    classDef compute fill:#d1fae5,stroke:#065f46,stroke-width:1px,color:#0f172a;
    classDef storage fill:#e5e7eb,stroke:#374151,stroke-width:1px,color:#0f172a;
    classDef external fill:#fce7f3,stroke:#9d174d,stroke-width:1px,color:#0f172a;
    classDef obs fill:#f3e8ff,stroke:#6b21a8,stroke-width:1px,color:#0f172a;
    class APP,PSVC,HOURS,NEAR,BBOX,KNN,SRCH,AUTOC,RSVC,PHOTO,MOD,CHECK,BOOK,NOTIF service;
    class PDB,GIDX,INV,RDB datastore;
    class RANK,SPAM,AGG compute;
    class IMG storage;
  • Quadtree / geohash / S2 index for spatial queries.
  • Nearby: walk parent cells outward until k results found.
  • Bounding-box: directly query cells overlapping the box.

Ranking#

  • Combines distance, star rating (with min-review threshold), photos, recency, paid promotion.
  • Personalization on top: user history, similar users.

Anti-spam reviews#

  • ML classifier on text + behavioral signals.
  • Hide vs filter: filtered reviews exist but not surfaced; transparent UX.

Glossary & fundamentals#

Concepts referenced in this design. Each row links to its canonical page; the tag column shows whether it is a high-level (HLD) or low-level (LLD) concept.

Tag Concept What it is Page
HLD CDN edge caching for static assets cdn
HLD Geo indexing Geohash, Quadtree, S2, H3, R-tree geo-indexing
HLD Search internals inverted index, BM25, embeddings, ANN search-internals