Skip to main content
BLUEPRINT #01Location & Geospatial

Design a Proximity Service (Yelp / Places Nearby)

Target AWS Architecture:DynamoDBAuroraElastiCacheOpenSearch
10-Stage Structure:1. Requirements→2. Sizing→3. Topology→4. Data Model→5. AWS Topology→6. Deep-Dive→7. Failures→8. SRE Playbooks

1. Problem Statement & Scope

System Mission

Design a high-scale location-based proximity service allowing users to discover nearby businesses and points of interest (POI) within a given radius (e.g. 5 km) with sub-100 millisecond response times.

Functional Requirements

  1. Add / Update POI: Create or update business profiles and GPS coordinates.
  2. Search Nearby POIs: Query nearby businesses given user GPS coordinates and radius.
  3. Filter & Rank: Filter by category, star ratings, and sort by distance.

Non-Functional Requirements (SLAs/SLOs)

  • High Read Throughput: 1,000:11,000:1 read-to-write ratio.
  • Latency: search latency <50Β ms< 50\text{ ms}.
  • Availability: 99.999%99.999\% uptime .

2. Capacity & Scale Estimation

  • Total Registered POIs: 200 Million (2Γ—1082\times 10^8).
  • Search : Average: 50,000Β QPS50,000\text{ QPS} (Peak: 125,000Β QPS\mathbf{125,000\text{ QPS}}).
  • POI Raw Storage: β‰ˆ200Β GB\approx \mathbf{200\text{ GB}} (Fits entirely in memory or small database cluster).

3. AWS-First High-Level Architecture

Interactive Architecture Diagram
Synthesizing vector architecture diagram...

4. API Interface Design

http
GET /v1/places/nearby?lat=37.7749&lon=-122.4194&radius_m=5000&category=coffee&limit=20
Host: places.production.aws.internal

Response: 200 OK
{
  "places": [
    {"business_id": "biz_101", "name": "Blue Bottle Coffee", "distance_meters": 340.5, "rating": 4.7}
  ]
}

5. Data Models & Storage Architecture

Amazon Aurora PostgreSQL PostGIS Schema

sql
CREATE EXTENSION IF NOT EXISTS postgis;

CREATE TABLE businesses (
    business_id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    name VARCHAR(255) NOT NULL,
    category VARCHAR(64) NOT NULL,
    geohash_code VARCHAR(12) NOT NULL,
    location GEOGRAPHY(Point, 4326) NOT NULL,
    rating NUMERIC(2, 1) DEFAULT 0.0
);
CREATE INDEX idx_businesses_spatial ON businesses USING GIST (location);

6. Component Deep Dives & Workflows

1. 9-Cell Geohash Expansion Query Sequence

Interactive Architecture Diagram
Synthesizing vector architecture diagram...

Part 2: Production Deep-Dive Locked1 Coin = 24 Hours

Unlock Complete Architecture & Production Runbooks

Your Balance:40 Coins

You have explored the free architectural preview (~47%). Spend 1 Coin to unlock the remaining 4 production deep-dive sections for a full 24 hours.

Sections Included in This 24-Hour Pass:
7. Architectural Trade-Off Matrix & Primitive Links
8. Critical Edge Cases & Distributed Failure Modes
9. Production Pitfalls & Anti-Patterns (The "Gotchas")
10. Production Runbook & Operational Best Practices
Keeps page unlocked for exactly 24 hoursSpend coins to fund LLM & compute infrastructure