Skip to content

Case study: Web crawler

Design a polite, planet-scale web crawler: two-tier priority and per-host frontier queues, Bloom-filter URL deduplication, SimHash content deduplication, and spider-trap defences.

35 min9 steps

By the end you can
  • Estimate crawl throughput, ingress bandwidth, Bloom filter memory, and fetcher concurrency
  • Design a two-tier URL frontier that separates global page priority from per-host politeness
  • Combine URL canonicalisation, Bloom filters, and SimHash to eliminate duplicate work
  • Predict how the crawler handles link discovery bursts, fetcher crashes, and spider traps

Pin down what you are building

Fetch, parse, deduplicate

  • Seed URLs; canonicalisation; robots directives; prioritised recrawls

Polite and durable

  • One in-flight request/host + delay; persistent frontier; trap protection

Why can a web crawler not simply pull URLs from a single global FIFO queue across 500 fetcher workers?

Answer this step to continue.

What this lesson simplifies

  • The runnable cell simulates 1,800 requests/s over 15,000 URLs and 5,000 domains; planet-scale numbers are derived in the estimates.
  • URL deduplication is modelled with a dedupStore node; the interactive SketchesPlayer below demonstrates Bloom filter false positives directly.
  • SimHash Hamming-distance clustering is discussed in the text rather than computed per simulated packet.

Sources

  1. A. Heydon, M. Najork. Mercator: A Scalable, Extensible Web Crawler, 1999.
  2. G. S. Manku, A. Jain, A. Das Sarma. Detecting Near-Duplicates for Web Crawling, 2007.
  3. M. Koster, G. Illyes, H. Zeller, L. Sassman. Robots Exclusion Protocol (RFC 9309), 2022.

Reviewed by Content lead on . Revision 1.