Cache hit
The Query API finds a popular query in memory and returns the cached result.
Flow
Client → Web Server → Query API → Memory Cache.
Interactive diagram · architecture
The Query API finds a popular query in memory and returns the cached result.
Client → Web Server → Query API → Memory Cache.
The API finds matching documents, gets titles and snippets, then saves the contents in the cache.
Query API → Reverse Index Service → Document Service → Memory Cache.
Cached entries expire so page changes, removals, additions, and rank changes can be refreshed.
The client sends a search request.
It resolves the site name with DNS. It then sends the request to the Load Balancer.
DNS maps a name to an address.
It receives the client lookup. The client then sends its request to the Load Balancer.
A load balancer spreads incoming requests.
It receives requests from the Client. It sends each request to a Web Server.
Load balancers add another component to operate.
The web server runs as a reverse proxy.
It receives a request from the Load Balancer. It forwards the request to the Query API.
The Query API parses and processes a search query.
It receives the web request and checks the Memory Cache. On a miss, it asks the Reverse Index Service for matching documents.
This service finds documents that match a query.
It receives the normalized query from the Query API. It ranks matching results and passes the top ones to the Document Service.
This service returns document titles and snippets.
It receives top matches from the Reverse Index Service. It returns contents for the Query API to place in the Memory Cache.
The Memory Cache holds query results in memory.
It receives lookups from the Query API. On a hit it moves the entry to the front of the LRU list and returns cached contents; on a miss, the Query API uses the Reverse Index Service.
Limited memory means older entries need to expire.
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 three steps.
Popular queries return from the Memory Cache.
The API updates the entry’s position at the front of the LRU list and returns cached contents.
The API finds, ranks, and enriches matching documents.
The result is placed at the front of the Memory Cache’s LRU list.
A time to live refreshes cached entries.
Use it when page contents, pages, or page ranks change.