Hypothetical scenario. Northwind wants searchable public supplier documentation. Dev begins with a queue of discovered links. Priya opens a page that leads to more calendar URLs and another host, then asks when that queue is allowed to stop growing.
Dev: “Every fetched page can supply more work.”
Maya: “Which candidates belong to the approved collection, and when are they eligible to fetch?”
Build a frontier that connects discovery provenance, host scheduling, fetching and document identity. Limit the case to approved public HTTP documents; private accounts, login automation and arbitrary scripts remain excluded. This workload does not inherit feed or chat rates.
Which discovered link is eligible to enter the frontier?
A frontier is retained work with policy attached. Each candidate needs an identity, discovery provenance, eligibility state and a next eligible fetch time. A FIFO queue alone cannot express a host-specific pause or distinguish an already fetched document from a newly discovered address. Treat the queue as a delivery mechanism for frontier records, not the only authoritative memory.
Start with an explicit host allowlist and a collection budget. Normalize URLs only through transformations whose meaning you understand. Removing fragments from an HTTP fetch identity is different from deleting query parameters that might select a different document. Keep the original discovered URL for diagnosis alongside the chosen normalized key.
URL deduplication answers whether this fetch candidate is already known. Content deduplication answers whether fetched representations match under a selected comparison. Two addresses can return identical bytes, and one address can change over time. Retain a fetch timestamp and representation identity rather than overwriting those distinctions with one undated body.
Schedule eligible hosts before issuing requests
Maintain a host scheduling view that combines the frontier, current robots policy, selected delay and outstanding work. A worker claims an eligible candidate conditionally, then rechecks the destination and policy at the fetch boundary. Separate the selected scheduling delay from claims about standard HTTP fields; the course does not assume every site publishes a crawl-delay directive.
Bound both concurrent work and response consumption. Connection deadlines alone do not prevent an endless body, oversized decompression or excessive parser memory. Apply byte, decompressed-size and processing limits, and record the reason for truncation. A partially fetched body must not masquerade as a complete document in the search index.
After a successful fetch, store the representation and metadata durably, then publish an indexing obligation through a recoverable transition. Discovered links return through the same admission rules. They do not inherit permission from their referring page. This closes the loop without allowing the parser to bypass the scheduler.
Schedule a host before fetching its URLs
Hypothetical scenario. The frontier stores canonical fetch candidates under host queues. A scheduler chooses a due host, claims its current generation and admits one URL according to the declared politeness interval. The next-allowed time is a shared host policy, not a separate timer for every worker.
| Frontier record | Fields | Purpose |
|---|---|---|
| URL candidate | canonical URL, discovery source, priority | Coverage selection |
| Host state | next_allowed, generation, owner | Shared politeness |
| Fetch attempt | URL identity, owner epoch, deadline | Bounded execution |
| Content evidence | digest, fetched time, source URL | Version / duplicate analysis |
URL normalization removes only equivalences the design can justify. Host aliases, redirects and query parameters can change identity or meaning; two different URLs can return identical content, while one URL can change over time. Keep canonical URL identity, host-budget identity and content digest separate.
Reassignment must fence the old scheduler at the actual fetch-admission boundary. A stale worker that continues fetching can violate the host budget even if its results are later rejected. If the transport cannot enforce such a fence directly, route starts through a current shared admission authority. Bound frontier growth, redirect depth, response size and parser work so discovery cannot consume unbounded resources.
Derive a host-limited collection rate
Hypothetical worked example. Select 1,000 approved hosts and one fetch start per host every ten seconds, with no overlap within a host. The policy ceiling from starts alone is 1,000 ÷ 10 = 100 fetches per second. It is not a measured throughput: slow hosts, robots restrictions, failures and exhausted frontiers lower it.
Select a mean complete payload of 100,000 bytes. At that ceiling, payload demand is 100 × 100,000 = 10,000,000 bytes per second, or ten decimal MB per second. For a selected one-hour run, 60 × 60 = 3,600 seconds, so the payload subtotal is 10,000,000 × 3,600 = 36,000,000,000 bytes, or 36 GB. Storage replicas, indexes and protocol traffic are excluded.
Now suppose each completed page discovers twenty candidate links. At one hundred completions per second, discovery yields 100 × 20 = 2,000 candidate observations per second. If selected admission rules retain one hundred fifty distinct eligible candidates per second while the fetch stage completes one hundred, frontier growth is 150 − 100 = 50 candidates per second. Over one hour that is 50 × 3,600 = 180,000 additional candidates. A bounded collection needs admission or prioritization, even though the fetch workers are healthy.
In the wild: robots rules have a defined scope
RFC 9309 specifies the Robots Exclusion Protocol, including matching, retrieval errors and caching. It explicitly distinguishes these rules from access authorization. Implement the actual applicable user-agent rules, then apply Northwind’s additional collection policy. A robots allowance is not a credential, a license or proof that every destination is safe.
Record which policy result governed a fetch. Cached policy has an age and retrieval outcome; do not silently convert an unreachable policy service into unrestricted crawling. The service can choose a stricter pause policy while retaining the protocol evidence needed to explain that choice.
A calendar can consume the frontier
Hypothetical failure scenario. A supplier calendar exposes a next-month link indefinitely. Every address is syntactically valid and every response is small. The crawler keeps adding future months until lower-priority documentation waits behind an expanding host frontier. Extra fetch workers do not solve the unbounded admission rule.
Limit retained candidates per host and collection, track discovery depth where useful, and allow a host to be paused without losing provenance. Exact URL deduplication does not stop a stream of distinct calendar addresses. Similarity checks can reduce redundant storage, but they run after a fetch unless earlier evidence is available.
Choose coverage deliberately
Use this architecture when a declared public-document collection needs controlled refresh and searchable provenance. For a small supplier set, a database-backed frontier and modest worker pool can be easier to inspect than a distributed crawler framework. Choose a framework when its actual scheduling and recovery model match the requirements, not because the word crawler implies global scale.
Do not confuse an empty ready queue with completion: delayed candidates, failed policy retrieval and deferred hosts can remain. Report admitted, eligible, fetched, indexed, rejected and postponed states separately. The search product should show when evidence was fetched rather than claiming that all supplier content is current.
Challenge the proposed mechanism
Two schedulers use different aliases for one host budget after handoff. What should the review inspect?
Reveal the design reasoning
The host-budget identity rule and enforcement at fetch start, including stale-owner rejection. URL string deduplication alone does not enforce shared politeness. Record where alias resolution is justified and its limits.
Decision and reconsideration: Choose explicit host and URL identities. Fence fetch admission and bound the frontier independently from content deduplication.
Check the design against changed conditions
The scheduler could start one hundred fetches per second. Is that the promised collection throughput?
Reason through the consequence
No. It is a selected policy ceiling under active eligible hosts. Latency, response limits, host rules and completion failures can reduce useful throughput.
Two URLs return the same body. May their provenance be discarded?
Reason through the consequence
Content storage may be shared under a selected digest rule, but address, fetch time, policy and discovery provenance still explain how that representation entered the collection.
The frontier grows fifty candidates per second. Should the collection merely add workers?
Reason through the consequence
First check host policy and collection budgets. Admission, deduplication and prioritization must bound retained work; additional concurrency may violate the very host constraint limiting useful fetching.
The baseline bounds discovery and host scheduling. Page 58 changes the source and failure conditions, asking how recrawling, redirects and hostile inputs affect that frontier without removing its policy boundaries.
Northwind decision log
Bound admission and schedule by eligible host, with explicit fetch limits.
Retain URL provenance separately from representation identity.
Next, defend the same loop against changing destinations and repeated content.
Go deeper: Crawl identity and bounded streams
- Book chapter: Mining of Massive Datasets: chapter 3: Finding Similar Items — Jure Leskovec, Anand Rajaraman and Jeffrey David Ullman. Use this resource to examine similarity does not replace URL provenance.
- Book chapter: Mining of Massive Datasets: chapter 4: Mining Data Streams — Jure Leskovec, Anand Rajaraman and Jeffrey David Ullman. Use this resource to examine bounded processing of an arriving candidate stream.
- Video lecture: CS246 Winter 2019: locality-sensitive hashing lectures — Stanford CS246 teaching team. Use this resource to examine similarity candidates before selecting a deduplication policy.
- Primary document: RFC 9309: Robots Exclusion Protocol — IETF. Use this resource to examine robots matching and retrieval-error handling.