Jump to a problem, path or page
Jump to a problem, path or page
01 · Frame the problem
Design a crawler for an explicitly approved set of public websites. URLs may form cycles, pages can be enormous and one host must not consume all worker capacity.
The frontier determines uniqueness and scope, while the fetch pipeline must respect shared host limits and bounded resource use. URL identity, redirect policy and claim recovery need explicit definitions before scaling workers.
02 · Find the design pressure
Begin with a durable deduplicated URL frontier. A per-process visited set forgets progress on restart and cannot coordinate workers. Shared claims and host budgets add parallelism without multiplying fetches or violating the crawl's scope.
03 · Define success
Workload: 5,000 reads/s, 2,000 writes/s, 1000 B records, 300 ms read p99 target. These are exercise assumptions; the Solution includes capacity formulas.
04 · Identify the correctness boundary
Canonical URL identity must follow a documented normalization policy; overly aggressive normalization can merge distinct resources. Claim frontier items with expiring ownership, but enforce shared host budgets across all workers. Redirects, decompression and parsing each need their own size and deadline limits.
05 · Make it concrete
Two pages link to the same canonical URL. One frontier row is created and one worker claims it. If the worker crashes, its claim becomes eligible again. A redirect to a disallowed host is rejected before fetching, even though the original URL was inside the approved crawl scope.