SkyCheck is building a weather API service that developers use to get current weather and 5-day forecasts. The service:
- Aggregates sources - fetches data from 3 upstream weather providers (OpenWeather, WeatherAPI, AccuWeather) and merges/averages the results for better accuracy.•Caching - weather data doesn't change every second. Cache results per location for 10 minutes to reduce upstream API calls and cost.•Location support - accept queries by city name, zip code, or lat/long coordinates. Auto-detect user location via IP if not specified.•Rate limiting - starter tier: 100 calls/hour; pro tier: 10,000 calls/hour per API key.•Historical data - store and serve the last 30 days of weather data per location.
Expected usage: 500,000 API calls per day across 10,000 API keys.
Design a weather API that aggregates data from multiple providers, caches results, and serves forecasts. Build this architecture under realistic production constraints, then validate tradeoffs in the design lab simulation.
Request path: The solution keeps ingress, service logic, and stateful dependencies separated so each layer can scale independently.
Reference flow: Web Clients -> API Gateway -> API Service -> Primary SQL DB -> Redis Cache