How can a search engine answer billions of queries in a blink?
In 1994 a web search engine got about 1,500 queries a day. By 2012 Google was answering over 3.5 billion.
▶ Start the storyA search engine answers billions of queries by never asking one machine to do it alone. Its index is cut into pieces called , each shard is copied onto several servers, and every question is sent to many machines at once before their answers are merged. The engine is part of a system that can span many around the world.
The growth has been dizzying. In early 1994 the World Wide Web Worm, an early search engine, got about 1,500 queries a day. By November 1997 AltaVista claimed roughly 20 million a day. By 2012 Google was handling more than 3.5 billion searches per day, from an index of over 30 trillion pages.
A 2003 report showed how Google kept up. At peak it served about 1,000 queries a second, and instead of expensive supercomputers it used a cluster of some 15,000 ordinary PCs, with software written to cope with the ones that failed. Its index was split by document into , and each shard was copied onto several servers; as traffic grew, Google added more copies so that more machines could answer at once. A web server sends each query out to the index servers, merges and ranks what comes back, then adds page summaries, spelling suggestions and ads.
Step 1: A query arrives
A web server takes charge of it
Step 2: Fan out
Sent to index servers, each holding some
Step 3: Search in parallel
Every slice is searched at the same time
Step 4: Merge and rank
Results combined, ranked and summarised
Step 5: Finish the page
Spelling suggestions and ads are added
Speed sometimes means settling for less. Google's 1998 prototype stopped searching once it had found 40,000 matching documents, to put a limit on response time, even though that might return results. Disks were the other enemy: a took about 10 milliseconds, and in early 2001 Google moved its whole index into memory, cutting waiting times sharply. All of this costs energy: in 2009 Google claimed a single search used about 1 kilojoule, enough to warm a litre of water by about a quarter of a degree.
Quiz me
0/3
Recap
Split the index into shards, copy each shard to share the load and survive failures, ask them all at once, and accept a very good answer fast.
💡 A trick to remember it · A thousand librarians each check their own shelf at the same moment, with a stand-in on every shelf in case one is off sick.
Surprising fact · In 2003 Google handled about 1,000 queries a second at peak on some 15,000 ordinary PCs instead of supercomputers.
Connects to
- 📇 How can a search engine find one word among billions of pages in a blink?
- 🧩 How do you split a database too big for one machine?
- ⚖️ How does a website spread millions of visitors across machines?
- 🗂️ How does an AI agent remember, and look things up before it answers?
- ⏳ How did a Danish telephone engineer invent the mathematics of waiting in line?
Sources (5)
No source, no claim. Every fact in this lesson (20 claims) cites at least one of these.