How do you split a database too big for one machine?
Google's Bigtable cuts its tables into pieces of a few hundred megabytes to a few gigabytes, and thousands of servers each look after some of them.
▶ Start the storyWhen a database is too big for one machine, you cut it into pieces and give each piece to a different machine. Each piece is called a shard: a , meaning the rows of a table are divided up, each shard on its own database server. Instead of one giant table, you have many smaller ones, each in charge of its own slice of the data.
The splitting pays off twice. Since each server holds fewer rows, its indexes are smaller, which generally makes searching faster. And the work is shared across a large number of machines, which can significantly improve performance. The cut can follow real-world lines, such as European versus American customers, so the system can tell which shard to ask and query only that one.
Step 1: One huge table
Too big for a single machine
Step 2: Cut by rows
At chosen keys, such as a customer region
Step 3: One shard per server
Each holds its own slice
Step 4: Find the shard
Ask only the server that has your row
Google's Bigtable does this on a huge scale. It splits its tables at certain row keys into of a few hundred megabytes to a few gigabytes, and hundreds to thousands of servers share thousands to hundreds of thousands of tablets. It is built so you can add machines and let the system start using them without .
few hundred MB
But in practice, sharding is complex. The aim is to minimize the need for cross-shard access, because a query that must visit many shards loses the benefit. Small tables are simply copied in full onto every server. Choosing how to cut matters too, and tools such as help spread large loads across servers.
Quiz me
0/3
Recap
Shard by cutting rows into independent pieces on different machines, and keep queries from needing many pieces at once.
💡 A trick to remember it · One encyclopedia, many volumes, many shelves: a shard is a volume, and a good cut means you only need one.
Surprising fact · Bigtable cuts tables into tablets of a few hundred megabytes to a few gigabytes, served by hundreds to thousands of servers.
Sources (3)
No source, no claim. Every fact in this lesson (16 claims) cites at least one of these.