1 · Crawl pages
Crawler Service pulls ranked links, avoids already-crawled pages, and sends follow-on work through two queues.
Interactive diagram · architecture
Crawler Service pulls ranked links, avoids already-crawled pages, and sends follow-on work through two queues.
The reverse-index queue feeds the service that maps words to the pages that contain them.
The document queue feeds the service that creates static titles and snippets for pages.
A client request reaches Query API, which uses the reverse index and document service to return relevant pages.
The user enters a search term and sees relevant pages.
It asks DNS where to connect, then sends the search request to Load Balancer. It receives titles and snippets in the result.
DNS resolves a name so the client can find the service.
It receives the lookup from Client and gives back the connection destination. Client then sends its request to Load Balancer.
DNS is an extra dependency before the request reaches the crawler system.
A load balancer distributes incoming requests across service instances.
It receives the search request from Client and passes it to Web Server. The stacked copies show that it can have several instances.
It adds another component to operate before requests reach Web Server.
The public web layer accepts the client request.
It receives traffic from Load Balancer and forwards the request to Query API. The response returns through this web layer to Client.
Using a reverse proxy adds another hop in the request path.
The public REST API parses a search query.
Web Server forwards the request here. Query API uses Reverse Index Service, then Document Service, to return matching pages with titles and snippets.
Query parsing adds work before results can be returned.
This service builds a reverse index of words to pages.
Index Queue delivers crawl jobs to it. It returns documents that match a query to Query API.
Generating the index is separate work from crawling pages.
This service creates static titles and snippets for pages.
Document Queue delivers crawl jobs to it. It passes page documents to Memory Cache and Query API uses it to return titles and snippets.
Titles and snippets are static and do not change for each query.
A queue holds reverse-index jobs.
Crawler Service adds a job here after it crawls a link. The queue hands that job to Reverse Index Service.
A queue separates crawling from indexing, so the work does not have to finish in the crawler loop.
A queue holds document-generation jobs.
Crawler Service adds a job here after it crawls a link. The queue hands that job to Document Service.
A queue separates document work from the crawler loop.
The service processes the highest-ranked page link in a loop.
It reads ranked links and signatures from NoSQL, then adds jobs to both queues. It writes the crawled link and page signature back to NoSQL.
It must detect similar pages so a graph cycle does not become an infinite loop.
A memory cache keeps generated page documents ready to read.
Document Service feeds it with titles and snippets. Query API can use those documents after Reverse Index Service finds matching pages.
Cached data can require an update strategy as pages are crawled again.
A key-value NoSQL database stores links to crawl and crawled links with signatures.
Crawler Service reads the next ranked link and checks similar page signatures here. It then removes the link to crawl and inserts the crawled link and signature.
Choosing SQL or NoSQL depends on the use cases and trade-offs.
Detail · follows playback, or click any box or step to pin it
Close · follow playbackClick any box for an explanation, or use Next or Play to walk through the four steps.
Crawler Service pulls ranked links, checks crawled signatures, and sends indexing and document jobs through queues.
It stores processed links and signatures in NoSQL.
Reverse Index Service creates the map from words to the pages that contain them.
The queue lets indexing run separately from crawling.
Document Service creates static titles and snippets for pages.
Generated documents are ready for a later search response.
Client reaches Query API through DNS, Load Balancer, and Web Server.
Query API uses the reverse index and page documents to return relevant pages.