System design paper · 2006
Bigtable
How Google stored huge tables on thousands of ordinary servers: one sorted map, ranges of rows per server and files that are never edited.
You’ll learn to
- Describe Bigtable’s data model, a sorted map from row, column and time to a value, and why the row name decides performance.
- Explain how a table is cut into tablets and how a client finds the server that holds one row.
- Follow a write through the log, memory and sorted files, and say what merging those files achieves.
- Name what later systems kept, changed or dropped.
Read first: Google File System
The idea in short
Google ran dozens of products, from web search to satellite maps, and each needed to store huge amounts of data on thousands of ordinary servers. A traditional database could not spread that far, so Bigtable offers something plainer: one giant table whose rows are kept in sorted order, with every value stamped with a time.
The sorted table is cut into ranges of rows, called tablets, and each tablet is served by one machine. A machine never edits a file in place. It writes each change to a log (a file that only grows at the end), keeps recent changes in memory, and saves them as sorted files that are only ever merged later. That makes writes fast and crash recovery simple.
The problem
By the mid-2000s Google was running dozens of products that all stored data in different shapes. The crawl tables held hundreds of terabytes of web pages. Google Earth held satellite images. Google Analytics held a row for every visitor session on every site that used it. Together they needed petabytes of room, spread across thousands of ordinary servers, and they ranged from batch jobs that read everything to services that had to answer users quickly.
A single database server could not hold this. Commercial databases that spread across many machines existed, but the authors say they wanted something else: control over how data is laid out on disk, and a system Google could change when it needed to. They also already had two building blocks. One was GFS, a file system that spreads huge files across many servers (see the GFS guide). The other was Chubby, a small lock service that keeps a few servers in agreement so that others can ask “who is in charge?”. What was missing was a way to turn files into tables that many programs could read and write at once.
So Bigtable was designed over about two and a half years, and by 2006 it was used by more than sixty Google products. By August 2006 there were 388 clusters outside testing, many of them idle for long periods, running on about 24,500 servers.
The question the paper answers is: what is the simplest table-like store that grows to thousands of machines, serves both batch jobs and live users, and lets its users decide where their data sits?