Web Crawler

A distributed crawler for training data: workers pull URL IDs from a durable frontier, check politeness and a local DNS cache, store raw HTML in S3, and hand parsers only a reference ID.

  • Goal: 10 billion pages in 5 days (432,000 s)
  • Page: 2 MB average transfer
  • Instance: 200 Gbps at 30% = 3,750 pages/sec
  • Fleet: 8 instances ~3.9 days (ideal network)
  • Politeness: 1 request/sec per domain
  • Depth: 15–20 hops max

Frontier queue

A durable queue of URL IDs waiting to be fetched. Workers pull from it; parsers push newly discovered URLs back into it.

Crawler workers

Pull a URL ID, check robots.txt and the domain rate limit, resolve DNS from the local cache, fetch the HTML (2 MB on average) and store it in S3.

Redis politeness

Holds per-domain locks and a sliding-window rate limiter so the whole fleet sends at most 1 request/sec to any domain, plus cached robots.txt rules.

Local DNS cache

Answers hostname lookups locally so workers do not wait on a DNS provider for every fetch.

Metadata DB

DynamoDB with a URL table (status, depth, content hash) and a domain table (robots rules, next allowed time).

S3 raw HTML

Stores each fetched page's raw HTML. Downstream stages refer to it by ID.

Parsing queue

Carries lightweight reference IDs from fetch to parse; never the HTML itself.

Parsing workers

Read the HTML from S3 by ID, extract text and child links, store the text, and enqueue new URLs within the 15–20 hop depth cap.

S3 text

Holds the extracted text that feeds training data, keyed to the page.

Content-hash dedup

Checks whether this exact content has been stored before, using a content-hash global secondary index, optionally fronted by a Bloom filter.

Dead-letter queue

Holds URLs that failed repeatedly after exponential backoff, so they stop cycling through the frontier.