How it works
Seed URLs enter a durable frontier, the stored list of URLs waiting to be fetched. A worker leases an eligible URL, meaning it claims the URL for a limited time, then checks crawl policy, resolves the host, fetches the response with bounds, and records the outcome. A parser validates the response, extracts document information and links, and hands accepted content to storage or an index pipeline. Links that pass filtering and deduplication return to the frontier.
Trace one page, with example values. A worker leases example.org/guide with a 5-minute lease and gets a 200 response of 180 KB. The parser finds 40 links. A filter drops 25 as already seen or out of scope, so 15 become new frontier entries, and the document goes to the sink. Only then is the lease marked complete. Each fetched page can create more work, which is why a crawl needs a budget rather than waiting for a natural end.
Keep each stage observable and independently recoverable. A worker crash after fetching should not silently lose a URL; a lease can expire and make it eligible again. That means downstream writes and link insertion need idempotent keys or deduplication, because the same page may be processed twice. This is at-least-once processing: simpler than guaranteeing exactly one fetch, at the cost of occasional repeats. A successfully fetched page can still fail parsing, and a parsed page can still be excluded from indexing.
A worker crashes after downloading a page but before acknowledging its frontier item. What should happen?
The lease expires and the URL becomes eligible again. Reprocessing is safe when document storage and discovered-link insertion are idempotent.
Use this as a guide for self review; written answers are not graded.Keep in mind
- The frontier closes the discovery loop; parsing and storage are distinct stages.
- Leases and idempotent processing make worker failure recoverable.