Forecasts from a flaky weather provider

DesignEasy25 min

Your task

Design the forecast service behind a gardening app that shows each user a 7-day forecast for their location. Forecasts come from a third-party weather API that allows 100,000 calls a day on your plan. It is usually quick, but some days it takes 10 seconds to answer or returns errors for an hour. The app has 500,000 daily users spread over about 20,000 distinct locations, most users open it in the morning, and forecasts change a few times a day. Describe how the app gets forecasts, what users see when the provider is slow or down, and how you stay within the call quota.

It covers

  • Stale while revalidate
  • Circuit breaker
  • Api quota