Practice: Design a Weather Service
Weather service inspired by Weather.com and Apple Weather: stations and partners push observations, forecasts are cached and served from the CDN edge, and severe alerts go out through a background queue.
Build this system yourself on the canvas below. Add components, connect them, and run traffic simulations to see where your design holds up and where it breaks.
Functional requirements
- Show the current weather and a forecast for a city or location, on a page or in an app
- Accept new observations from stations and partners (about 50K stations) and keep them up to date
- Compute and store forecasts per area, refreshed on a schedule, so they can be served from a cache
- Send severe weather alerts to everyone in the affected area through a queue, once each
- Keep recent observations (for example the last 7 days) for charts and for building forecasts
- Limit and validate observation updates so a faulty station cannot overwrite good data
Non-functional requirements
- Forecast response < 100ms p99, served from the CDN and forecast cache (a forecast can be a minute old)
- A new observation is visible within 1 minute
- Alerts are sent within 2 minutes of being issued, and nobody in the warned area gets the same alert twice
- Handle 10K forecast requests per second at peak, mostly cache hits
- 99.99% availability for reads, even if observation intake is delayed
- Scale to 100M app users; popular cities are cached at the edge so the database is rarely read
- Alert fan-out to millions of people is spread over workers and finishes within 2 minutes