Google does not search the web when you do. It built a cheat sheet first. Here is how that list works, how pages get ranked, and how it scales.
You type "pizza near me" and get answers before you blink. The web has billions of pages, and no computer reads them all while you wait.
So what is it doing? It doesn't search the web when you search. It searched days ago and wrote a cheat sheet. Your query only reads the cheat sheet. Let's build one from a tiny version.
You have 5 pages and want the ones containing "pizza". Open each, look for the word. Done in a blink.
Now make it a billion pages. That would be like re-reading a whole library every time someone asks one question.
Click through the journey once, from web page to your screen.
Crawlers fetch pages and follow their links
Notice that you only show up at step 3. The rest was already done. The next question: where do the pages come from?
Programs called crawlers fetch a page and pull out its links. Then they fetch those pages too, and so on, forever. It is like following a link, then the links on that page, then the links on the next one.
The 1998 Google paper (Brin and Page) ran about 3 crawlers, each with roughly 300 connections open at once. At peak they pulled over 100 pages a second. Looking up website addresses (DNS) was a big slow part, so each crawler kept its own memory of them.
Pages are on disk now. How do we find "pizza" in them fast?
A normal book index maps a page to its words. Flip it: map each word to the pages that contain it. That's an inverted index.
| Word | Pages that contain it |
|---|---|
| pizza | 2, 7, 9 |
| recipe | 1, 7, 12 |
| oven | 3, 9 |
The paper calls the per-word list a doclist: all the documents a word appears in, plus where. Keeping each list sorted is the secret, and you'll see why now.
You want pages with both words. Walk down the two lists together, like comparing two sorted lists of numbers.
You never go back. So the work depends on the length of the two lists, not the size of the web. The paper keeps lists sorted by document ID for this reason. It allows "quick merging" of lists for multi-word queries.
But thousands of pages may match. Which goes first?
Order matters more than the match. The engine needs a way to tell a good page from a spammy one.
Brin and Page's idea is PageRank: a link is a vote, and votes from important pages count more. Picture a "random surfer" who keeps clicking links and sometimes gets bored and jumps to a random page. The more often they would land on a page, the higher its rank.
The paper's formula uses a damping factor d, usually 0.85. That is the chance the surfer keeps clicking instead of jumping away. The paper reports that PageRank for 26 million pages could be computed in a few hours on a medium-size workstation.
The final rank also uses where the word appears (title, anchor text, nearness of words) plus PageRank. Anchor text is the clickable words of a link. The paper uses it to describe the page the link points to.
That works on a laptop. What breaks at web scale?
The paper is blunt: a disk seek takes about 10 ms, so the design avoids seeks wherever it can. Here's the map from "works on a laptop" to "works for everyone".
| Bottleneck | Standard fix |
|---|---|
| Too many pages for one disk | Split the index across many machines (a shard each) |
| Too many searches at once | Keep copies (replicas) of each shard |
| Popular searches repeat | Cache the answers |
| Disk is slow | Keep hot parts in memory |
The paper itself splits its inverted index into 64 "barrels", each holding a range of words. It also keeps a small set of lists for title and anchor hits. It checks those first, and only checks the bigger lists if there aren't enough matches. Google's own docs state that today's index is hosted on thousands of computers, but they don't explain how it's split.
That diagram is the general sharding idea, not a claim about one company's setup. Each shard answers for its own slice, then the best results get merged.