SystemKit

Design a retail price monitor

Apply the chapter's scheduling and politeness ideas to targeted rechecks, where each site's request budget decides what is possible.

The brief

A service tracks product prices across many online retailers, shows customers price history, and raises an event when a price changes. URLs come from customer watchlists and retailer sitemaps, so this is targeted rechecking rather than open link discovery. Some products need rechecks every 15 minutes and most need one a day. The crawler must respect robots.txt and each site's rate limits. Alert delivery, logging in to retailers, and purchasing are outside this exercise.

  • Track 50 million product URLs across 20,000 retail sites. The 100 largest sites hold 60% of those URLs.
  • 1 million priority products are rechecked every 15 minutes, and the other 49 million once a day. Add 10% to fetches for retries. Use decimal units and 86,400 seconds per day.
  • A product page averages 400 KB. 20% of fetches need a headless browser, at about 2 CPU-seconds per render. These are example figures to verify.
  • Store a 100-byte price observation per planned recheck for a year (retries add none), and raw HTML for 7 days.
  • The default budget is 1 request per second per site, lowered by robots.txt, 429, or 503 responses. An event for a priority product should fire within 20 minutes of a price change; treat this as a target to verify.

Reading a design isn’t the same as producing one under a clock. Try it timed: the requirement change stays hidden until partway through.

Loading your draft…

State your scope and assumptions. Estimate fleet fetches per second with retries, bandwidth, rendering capacity, and storage. Then work out one site's daily budget and compare it with a large site's URL count.

0 / 4,000 characters

Name the components and what each stores or does. Trace one priority product from becoming due, through robots and rate checks, to a stored price and a change event.

0 / 4,000 characters

Explain recovery from a crashed worker. Then handle a retailer redesign and a block page served with status 200, neither of which should create a false price. Say which site's budget is your bottleneck and how you would show it.

0 / 4,000 characters

Respond to the flash-sale change below. Show the per-site rate it implies, then say what you would build, what you would decline to build, and what you would tell the product team.

The requirement changesCustomers now want products in flash sales rechecked every minute for two hours. Assume 20,000 such products at a time, concentrated evenly on 5 retailers. Work out the per-site request rate this implies, decide what you would build, and say what you would tell the product team.

0 / 4,000 characters

Write an initial response in all four sections to unlock the checklist and two worked approaches.