Lesson 5 of 15
36. Design a Web Crawler

36.4 What do we store?

3 min read+10 XP
pages (object storage, Chapter 11) key: hash(url) + fetch time → compressed HTML url_state (key-value store, sharded by host) url (normalised), last_fetched, last_status, content_hash, next_due, priority, depth host_state host → robots.txt (cached ≤ 24 h), crawl delay, error rate, DNS answer + TTL seen_urls Bloom filter (per crawler node, for its hosts) content_seen content_hash → first URL (exact-duplicate detection)

Interviewer pushback:

  • "Why keep url_state if you have the Bloom filter?" → The Bloom filter only answers "probably seen?" cheaply. url_state holds what re-crawling needs: when we fetched it, whether it changed, and when it's due again.

Memory code: "Pages in object storage, state per URL and per host, a filter for 'seen?'."