Data Centers: The Backbone of Modern Databases
Concept. Latency in a modern data center spans eight orders of magnitude, from a nanosecond on-chip to a hundred milliseconds across the planet. An algorithm's cost depends on which tier holds its data.
Intuition. A SELECT against a 10-billion-row Listens table doesn't run on one machine. It runs in a data center the size of a Costco, and the same byte can be a nanosecond away or a hundred milliseconds away depending on where it sits. Data comes down to location, location, location.
Latency Tiers
On-chip is nanoseconds. Memory is hundreds of nanoseconds. Storage is tens of microseconds. Disk and the network next door are milliseconds, and the far side of the planet is a hundred of them. Every algorithm in this course is implicitly priced against that ladder; Storage & Paging puts exact numbers on the storage half.
Figure: One data center: seven orders of magnitude of latencySeven latency tiers on one axis, ordered fastest to slowest left to right: L1 cache 1 ns on-chip, RAM 100 ns on-board, SSD 100 microseconds same rack, network within the data center 500 microseconds an aisle away, spinning disk 10 milliseconds same rack, cross-region 50 milliseconds a continent away, cross-continent 100 milliseconds the other side of Earth. The span from end to end is 100 million times. An algorithm that reads from the wrong tier pays up to 10,000,000 times more. Color key: orange is a latency tier, grey is the fast-to-slow axis.
Figure 1. Seven tiers in one data center, fastest to slowest, from L1 cache at 1 ns to a cross-continent round trip at 100 ms. End to end is 100,000,000x.
Why a Database Course Cares
Every cost model we will use, every page-count analysis, every join algorithm, is shaped by this hierarchy. A query plan is a routing decision: which tier do you read from, how often, and in what order. Get the tier right and a billion-row query finishes in seconds. Get it wrong and the same query never finishes or costs 1000x more.
Google Data Centers
This is where BigQuery, Cloud SQL, and Spanner physically run.
Microsoft Azure Documentary
A behind-the-scenes tour of where your data physically lives.