Loading...
Functional Requirements:
Non-Functional Requirements:
We'll use RESTful APIs for standard queries and WebSocket/Server-Sent Events (SSE) for real-time live data updates.
GET /v1/weather/current?lat={lat}&lon={lon}200 OK with JSON payload containing temperature, humidity, conditions, etc.GET /v1/weather/forecast?city={city_name}&days={n}200 OK with a time-series array of forecasted conditions.POST /v1/alerts/subscribe{ "user_id": "string", "location_geohash": "string", "device_token": "string" }201 CreatedTo achieve our low latency and high availability goals, we must decouple the read path from the write/ingestion path.
1. Data Ingestion & Caching Strategy (The Core)
weather:{geohash}:current.2. Time-Series Database (TSDB)
geohash and sort by timestamp, making range queries for a 7-day forecast highly efficient O(1) to locate the partition, O(log N) to fetch the time range.3. Real-Time Alerting Pipeline
severe_weather_alerts Kafka topic.