Google System DesignDesignFree previewFree
Web Crawler at Search Scale
Last asked
Problem
Design a periodic crawler for tens of billions of pages feeding a search index, without JavaScript rendering. Deep dives cover a two-level URL frontier, robots.txt caching, exact and near-duplicate detection, crawler traps, host-based sharding, checkpoint recovery, and a 24-hour full-recrawl target.
- Crawl tens of billions of pages, revisit them periodically, and deliver parsed content to a search index. JavaScript rendering is out of scope.
- Close the loop as URL frontier → fetcher → parser → deduplication → storage, with newly extracted URLs fed back into the frontier.
- Balance priority with host politeness. Use front queues by priority and back queues by host so requests to one host are serialized and spaced while high-priority URLs still advance quickly. Define a
robots.txtcache policy. - Deduplicate both URLs and content. URL-level membership can combine hashing with a Bloom filter; content-level detection must handle the same page appearing at multiple URLs, using checksums for exact matches and a near-duplicate signal such as SimHash.
- Detect crawler traps such as infinite calendar pages and dynamically generated URL spaces by limiting per-domain depth and volume and recognizing pathological URL patterns.
- Distribute work by consistently hashing hosts to crawler nodes so one node owns each host's politeness state. Persist frontier checkpoints and recover ownership after node failure.
Follow-ups
Identify the bottleneck when the entire site corpus must be recrawled within 24 hours; bandwidth and DNS resolution become primary constraints, motivating capacity planning and a dedicated DNS cache.
Loading the solution…
