BLUEPRINT #01Location & Geospatial
Design a Proximity Service (Yelp / Places Nearby)
Referenced Architecture Primitives (4)
Click any primitive to study its algorithmic deep dive10-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
- Add / Update POI: Create or update business profiles and GPS coordinates.
- Search Nearby POIs: Query nearby businesses given user GPS coordinates and radius.
- Filter & Rank: Filter by category, star ratings, and sort by distance.
Non-Functional Requirements (SLAs/SLOs)
- High Read Throughput: read-to-write ratio.
- Latency: P99 search latency .
- Availability: uptime SLA.
2. Capacity & Scale Estimation
- Total Registered POIs: 200 Million ().
- Search QPS: Average: (Peak: ).
- POI Raw Storage: (Fits entirely in memory or small database cluster).
3. AWS-First High-Level Architecture
Interactive Architecture DiagramSynthesizing vector architecture diagram...
4. API Interface Design
httpGET /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
sqlCREATE 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 DiagramSynthesizing 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