Quick revision
The short answer
A billion pages a month is about 400 pages per second and about 100 TB of raw HTML a month. The crawler is a loop of components: a URL frontier with priorities and per-host politeness, a caching DNS resolver, fetchers that check a robots.txt cache, a parser and link extractor, a URL normaliser and seen-URL filter, content deduplication and a page store. Each URL record keeps its normalised form, host, last fetch time, status, content hash, next fetch time and priority, and each host keeps its robots rules, crawl delay and error rate.
What to remember
In this answer, we sized the crawl at about 400 pages per second and 100 TB of raw HTML a month, laid out the components, frontier, caching DNS, fetchers with a robots cache, parser, normaliser and seen filter, content dedup and page store, and followed one URL through the loop with robots and per-host delay checks before every fetch. We designed the per-URL record with its fetch time, status, content hash, next fetch and priority, and the per-host record with robots rules, delay and error rate. Finally, a Bloom filter answers seen-or-not cheaply at billions of URLs, and content hashes and SimHash skip duplicate pages.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
A billion pages a month is about 400 pages per second and about 100 TB of raw HTML a month. The crawler is a loop of components: a URL frontier with priorities and per-host politeness, a caching DNS resolver, fetchers that check a robots.txt cache, a parser and link extractor, a URL normaliser and seen-URL filter, content deduplication and a page store. Each URL record keeps its normalised form, host, last fetch time, status, content hash, next fetch time and priority, and each host keeps its robots rules, crawl delay and error rate.
Why this question is asked
A web crawler is a good design question because the core loop fits on a napkin, but doing it at scale and politely needs several careful pieces. Interviewers want to see that we can size the work, name the components with a reason for each, and follow one URL through the system. In this answer, we will turn the requirement into numbers, lay out the components, follow a URL from discovery to a stored page, design the per-URL and per-host records, and see how a Bloom filter and content fingerprints keep a crawler of billions of URLs from repeating itself.
1Turning the Requirement Into Numbers
A month has about 2.6 million seconds, so 1 billion pages a month is about 385 pages per second on average; we plan for about 400, with peaks perhaps twice that. If an average page is 100 KB of HTML, that is 1 billion x 100 KB = 100 TB of raw HTML a month, or around 20 to 30 TB after compression, since HTML compresses well. The bandwidth is about 400 x 100 KB = 40 MB/s, roughly 320 Mbps, which is modest.
The harder number is concurrency. A fetch takes perhaps 1 second including DNS, connection and download, so 400 pages per second means about 400 fetches in flight at any time, and many more when slow servers are involved. And because we must not hammer any one site, those fetches have to be spread over thousands of different hosts at once.
2The Components and Why Each Exists
The URL frontier is the to-do list of URLs, ordered by priority and arranged so that no host gets too many requests. Fetchers download pages. A caching DNS resolver sits in front of them, because looking up the same host's address for every page would add tens of milliseconds and overload DNS servers. A robots.txt cache holds each site's rules, the file in which site owners say which paths crawlers may visit and how slowly, so we fetch that file once a day per host rather than per page.
After download, a parser extracts text and links. A URL normaliser rewrites each link into one canonical form, lowercasing the host, removing default ports and fragments, resolving relative paths, so that the same page is not crawled under ten spellings. A seen-URL filter drops links we already know. Content deduplication spots pages whose content we already have under another URL. Finally, a page store keeps the raw pages, typically compressed in object storage such as S3.
- URL frontierpriority and per-host politeness
- Fetcherswith caching DNS and
robots.txtcache - Page storeraw pages in object storage, WARC-style files
- Parser and link extractortext and outgoing links
- URL normaliser and seen-URL filtercanonical URLs, Bloom filter plus URL store
- Content deduplicationexact hashes and
SimHashfingerprints
6 layers, from the top down. Step through them one at a time.
New URLs from the bottom layers flow back into the frontier.
3Following One URL From Discovery to a Stored Page
Let us follow https://example.com/news/42 after it is found on another page. It is normalised and checked against the seen-URL filter; it is new, so it enters the frontier with a priority. When its turn comes, the fetcher checks two things before connecting: whether the host's robots rules allow this path, and whether enough time has passed since the last request to this host. Only then does it download, with a timeout of perhaps 30 seconds and a size limit of a few MB, so one huge or endless response cannot tie up a fetcher.
- Take URL from the frontierhighest priority host that is due
- Allowed by robots.txt and host delay passed?rules from the robots cacheYesFetch itNoPut it back with a later time
- Download with timeout and size limitfor example 30 s and 5 MB
- Store raw page in object storagerecord status and content hash
- Parse and normalise linksabsolute, canonical URLs
- Drop URLs already seenBloom filter, then URL store
- Add new URLs to the frontierwith a priority
7 steps in order. Play them, or step through them one at a time.
The raw page goes to object storage first, before parsing, so that a parser bug never forces us to download the page again. Then the parser extracts links, the normaliser cleans them, the seen filter drops known ones and the rest join the frontier. The loop closes.
4What We Keep for Each URL and Each Host
Every URL we know about has a record, and every host has one too. The URL records live in a large key-value store such as Cassandra, Bigtable or RocksDB on each node, keyed by a hash of the normalised URL; the host records are far fewer and can live in memory on the node that owns the host.
The content hash lets a recrawl notice that a page has not changed, which also tells us to visit it less often. The host's error rate lets us back off automatically when a site starts struggling.
5Not Repeating Ourselves at Billions of URLs
With billions of known URLs, asking the URL store 'have we seen this?' for every extracted link would mean tens of thousands of lookups per second against disk. A Bloom filter answers most of them from memory. It is a bit array with several hash functions; to add a URL we set the bits its hashes point to, and to check one we see whether all those bits are set. If any bit is zero, the URL is certainly new. If all are set, it is probably seen, with a false-positive rate we choose. For 10 billion URLs at a 1 percent false-positive rate, the filter needs about 9.6 bits per URL, around 12 GB, which fits in memory across a few nodes.
A false positive means we skip a URL we have never seen, which a crawler can tolerate at 1 percent; where it matters, a 'probably seen' answer can be confirmed in the URL store. Content duplicates are a separate problem: the same article under different URLs. Exact copies share a content hash. Near-duplicates, which differ only in an ad or a date, are caught by a fingerprint such as SimHash, which gives similar documents fingerprints that differ in only a few bits, so we can skip storing and parsing pages we effectively already have.
6Follow-up questions
What should the crawler do if robots.txt cannot be fetched?
If the file returns 404, the site has no rules and crawling is allowed. If it times out or returns a server error, the safe choice is to treat the whole site as disallowed for a while and retry later, because we cannot know what the owner wants.
Why store raw pages rather than only the extracted text?
Parsers improve and downstream needs change. Keeping the raw HTML lets us re-parse the whole crawl without fetching it again, which is far cheaper than re-crawling and kinder to the sites.
How do you avoid fetching the same page under many URLs?
Normalisation catches spelling differences, the page's canonical link tag tells us the preferred URL, and content hashes and SimHash catch the rest after a fetch, so we lower the priority of duplicate URL patterns on that host.
7Conclusion
In this answer, we sized the crawl at about 400 pages per second and 100 TB of raw HTML a month, laid out the components, frontier, caching DNS, fetchers with a robots cache, parser, normaliser and seen filter, content dedup and page store, and followed one URL through the loop with robots and per-host delay checks before every fetch. We designed the per-URL record with its fetch time, status, content hash, next fetch and priority, and the per-host record with robots rules, delay and error rate. Finally, a Bloom filter answers seen-or-not cheaply at billions of URLs, and content hashes and SimHash skip duplicate pages.
Open with
A billion pages a month is about 400 pages per second, and at 100 KB per page that is about 100 TB of raw HTML a month before compression.
Then, if they want more
The components are a URL frontier with priorities and per-host politeness, a caching DNS resolver, fetchers, a robots.txt cache, a parser and link extractor, a URL normaliser and seen-URL filter, content deduplication, and a page store in object storage.
A URL flows like this: the frontier hands it out when its host is due, the fetcher checks the robots rules and the host's crawl delay, downloads with a timeout and size limit, writes the raw page to object storage, then the parser extracts links, they are normalised, seen URLs are dropped and new ones go back to the frontier.
For each URL I keep the normalised URL, host, last fetch time, HTTP status, content hash, next scheduled fetch and priority. For each host I keep robots rules, crawl delay and error rate.
At billions of URLs I put a Bloom filter in front of the URL store, which answers 'definitely new' from memory with about 10 bits per URL at a 1 percent false-positive rate, and I use content hashes for exact duplicates and SimHash fingerprints for near-duplicates so we skip copies of the same page.
About this answer
- Last updated
- 13 November 2026
- Checked
- Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the official documentation for the version you use. What the checks cover
- Where the question comes from
- Written by Scrivio for practice. It is not taken from an interview.
Report an issue with this answer
Copy the line below and send it to the author with what you found. It carries the address of this page.
Issue with "Outline the components of a web crawler that fetches 1 billion pages a month, the data...": https://scrivio-interview-library.netlify.app/architecture/system-design-problems/9ffbce8be0/