Skip to content

Landmark Distributed Systems Papers

Advanced 66 min read Part 9 of 18

The papers behind today's infrastructure: Paxos, LSM-tree, GFS, MapReduce, Bigtable, Chubby, Dynamo, ZooKeeper, Kafka and Spanner, and where each lives today.

Summary#

Most of the infrastructure that system designs use today, from Cassandra and HBase to Kafka, etcd, Hadoop, Spark, RocksDB and CockroachDB, descends from a small set of research papers published between 1990 and 2012. Paxos (Leslie Lamport) showed how a group of unreliable machines can agree on a value, and is the root of every replicated log, consensus service and strongly consistent database. The LSM-tree (Patrick O'Neil and colleagues) turned random writes into sequential ones by buffering in memory and merging sorted files, and now underlies RocksDB, Cassandra and nearly every write-heavy store. GFS (Google) built a petabyte file system from cheap disks with one metadata master and replicated 64 MB chunks, and became HDFS. MapReduce (Google) made parallel batch processing over thousands of machines a two-function programming problem, and begat Hadoop and Spark. Bigtable (Google) combined the LSM idea with GFS and Chubby into a sorted, sparse, wide-column store, and begat HBase, Cassandra's data model and Cloud Bigtable. Chubby (Google) packaged Paxos as a coarse-grained lock and naming service, and inspired ZooKeeper (Yahoo!), which offered wait-free coordination primitives, znodes, ephemeral nodes, sequential nodes and watches, and coordinated Hadoop, HBase and Kafka for a decade. Dynamo (Amazon) chose availability over consistency with consistent hashing, sloppy quorums, hinted handoff, vector clocks, Merkle trees and gossip, and begat Cassandra, Riak and Voldemort. Kafka (LinkedIn) treated messaging as a partitioned, append-only log read by pulling consumers, and became the backbone of event streaming. Spanner (Google) used GPS and atomic clocks, exposed through the TrueTime API, to give globally distributed transactions with external consistency, and inspired CockroachDB and YugabyteDB. Knowing the key idea of each paper, and the trade-off it made, lets you recognise the same idea inside any new system and explain design choices in an interview from first principles.

Why It Exists#

System design can look like a catalogue of products: Kafka for this, Cassandra for that, ZooKeeper for something else. But the products are mostly re-implementations and refinements of a few ideas, each first described in a paper that explained what problem it solved, what it gave up, and why. Reading the papers, or at least knowing their ideas, has three practical benefits.

  • You understand behaviour, not just features. Cassandra's tunable consistency, hinted handoff and read repair make sense only once you know what Dynamo was trying to achieve. HBase's region servers, write-ahead log and compactions are Bigtable's tablets, commit log and compactions under new names.
  • You can reason about new systems quickly. A new database that says "Raft-replicated ranges, an LSM storage engine and hybrid logical clocks" is Spanner's architecture with Raft for Paxos, RocksDB for Bigtable's storage, and a software substitute for TrueTime. Recognising the parts tells you its strengths and failure modes before you read its documentation.
  • You can justify trade-offs. In an interview, "I'd pick a leaderless, Dynamo-style store here because we need writes to succeed during partitions, and we can merge conflicting cart versions" is a much stronger answer than "I'd use Cassandra because it scales".

This page explains each landmark paper in plain terms: the problem, the key idea, how it worked, what it traded away, what later work changed, and where the idea shows up today.

How It Works#

The papers are presented roughly in the order of the ideas they depend on: agreement first, then storage, then the Google stack, then the systems that reacted to it. Each has a short explanation followed by an in-depth section.

The Google line, where each system was built on the ones before it:

And the open-source line, which re-implemented and recombined those ideas, together with Amazon's Dynamo:

Paxos#

The problem. A group of machines must agree on a single value, such as "which operation is next in the log", even though any of them may crash and restart, and messages may be delayed, lost, duplicated or reordered. No machine can tell a crashed peer from a slow one. Agreement must be safe, so that no two machines ever decide different values, and should make progress whenever a majority can communicate.

The paper. Leslie Lamport, "The Part-Time Parliament", ACM Transactions on Computer Systems, 1998. Lamport first submitted it around 1990, written as the story of a fictional parliament on the Greek island of Paxos whose part-time legislators wander in and out of the chamber. Reviewers found the allegory confusing, and it was published only years later. Lamport's "Paxos Made Simple" (2001) restated the algorithm in plain language in a few pages.

The key idea: majorities intersect. Any two majorities of the same group share at least one member. If a value has been accepted by a majority, any later majority must include someone who knows about it. Paxos builds on that fact with numbered proposals and two phases.

  1. Prepare. A proposer picks a proposal number n, higher than any it has used, and asks the acceptors to promise not to accept any proposal numbered below n. Each acceptor that promises also reports the highest-numbered proposal it has already accepted, if any.
  2. Accept. If a majority promised, the proposer sends "accept (n, v)", where v is the value of the highest-numbered proposal reported, or its own value if none was reported. Acceptors accept unless they have since promised a higher number. Once a majority accepts (n, v), v is chosen.

The rule that a proposer must adopt the highest previously accepted value is what makes Paxos safe: once a value might have been chosen by a majority, any later proposal that wins a majority of promises learns about it and proposes the same value. Competing proposers can delay each other forever, by repeatedly preparing higher numbers, which is consistent with the FLP impossibility result (Michael Fischer, Nancy Lynch and Michael Paterson, "Impossibility of Distributed Consensus with One Faulty Process", JACM 1985): no deterministic algorithm can guarantee termination in a fully asynchronous system with even one crash. In practice, electing a single distinguished proposer, with timeouts, gives progress whenever the network is reasonably timely.

Multi-Paxos. Real systems agree on a sequence of values, a replicated log. Running both phases for every log entry would be slow, so Multi-Paxos elects a stable leader that runs the prepare phase once for all future entries and then needs only one round trip, the accept phase, per entry. A write then costs one round trip from the leader to a majority, plus a disk write on each.

Where it shows up today. Chubby, Spanner and Megastore use Paxos. ZooKeeper uses Zab, a closely related atomic broadcast protocol. etcd, Consul, CockroachDB, TiKV, YugabyteDB and Kafka's KRaft use Raft, a consensus algorithm designed to be easier to understand and implement. Every "leader plus majority-acknowledged log" design is a descendant. See Consensus: Raft and Paxos.

Paxos, in depth#

Why it was hard to adopt. The original paper specified the core single-value algorithm precisely but left much of what a real system needs, leader election, log management, membership changes, snapshots and client interaction, loosely described. Tushar Chandra, Robert Griesemer and Joshua Redstone ("Paxos Made Live: An Engineering Perspective", PODC 2007) described building Chubby's Paxos layer and listed the gaps they had to fill: handling disk corruption, master leases, group membership changes, snapshots, and testing. Their conclusion, that the distance between the published algorithm and a production system was large, motivated much of the later work.

Viewstamped Replication. Brian Oki and Barbara Liskov ("Viewstamped Replication: A New Primary Copy Method to Support Highly-Available Distributed Systems", PODC 1988) independently described a primary-backup protocol with view changes that is essentially equivalent to Multi-Paxos, and it was revisited by Liskov and James Cowling in 2012.

Raft. Diego Ongaro and John Ousterhout ("In Search of an Understandable Consensus Algorithm", USENIX ATC 2014) designed Raft explicitly for understandability. It splits the problem into leader election, with randomised election timeouts, log replication, where the leader forces followers' logs to match its own, and safety, where only a candidate whose log is at least as up to date as a majority's can win. It specified membership changes and snapshots, and a user study found students understood Raft better than Paxos. Raft's clarity is why most consensus systems built since 2014 use it.

Why majorities, and what they cost. A cluster of 2f + 1 nodes tolerates f failures: 3 nodes tolerate 1, 5 tolerate 2. Each write waits for a majority, so latency is set by the median-fastest follower. Within one data centre, that is well under a millisecond of network time plus an fsync of perhaps 0.1 to 10 ms depending on the disk; across regions, it is the round trip to the nearest majority, often 30 to 100 ms. This is why consensus is used for metadata and coordination, or for partitioned data where each partition has its own group, and not as a single global log for all writes.

Flexible quorums. Heidi Howard, Dahlia Malkhi and Alexander Spiegelman ("Flexible Paxos: Quorum Intersection Revisited", 2016) showed that only the prepare quorums and the accept quorums must intersect, not every pair of quorums. So a system can use small accept quorums for fast writes and larger prepare quorums for rare leader changes, a useful idea for geo-distributed systems.

The LSM-tree#

The problem. In the early 1990s, transaction systems needed to index a fast-growing history table, such as a record of every bank transaction, for later lookup. A B-tree index on a large table needs random disk writes: each insert updates a leaf page somewhere on disk. Disks of the day managed perhaps 100 random I/Os per second, but could transfer data sequentially far faster. Indexing every insert in a B-tree made the disk arm the bottleneck.

The paper. Patrick O'Neil, Edward Cheng, Dieter Gawlick and Elizabeth O'Neil, "The Log-Structured Merge-Tree (LSM-Tree)", Acta Informatica, 1996.

The key idea: defer and batch. Keep the newest index entries in a small, fast, in-memory component, called C0. When it grows large, merge it, in sorted order, into a larger on-disk component, C1, written with long sequential I/O. With more levels, C1 merges into C2, and so on, each larger than the last. A lookup checks the components from newest to oldest. Because merges read and write whole sorted runs sequentially, the cost of each insert is amortised over many entries, and the disk does far fewer random writes. The paper called the merge process a rolling merge, and analysed the cost using the economics of disk arms versus memory.

How modern LSM engines work. Today's LSM engines, such as LevelDB, RocksDB and Cassandra's storage engine, follow a form popularised by Bigtable:

  1. A write is appended to a write-ahead log for durability, then inserted into the memtable, a sorted in-memory structure such as a skip list.
  2. When the memtable reaches a size, such as 64 MB, it is frozen and flushed to disk as an immutable sorted file, an SSTable, sorted string table.
  3. Background compaction merges SSTables, discarding overwritten values and deleted entries, to keep the number of files a read must check small.
  4. A read checks the memtable, then SSTables from newest to oldest, using a per-file Bloom filter to skip files that cannot contain the key, and a sparse index to find the right block within a file.

Where it shows up today. Bigtable, HBase, Cassandra, ScyllaDB, LevelDB, RocksDB, which is embedded in many systems including CockroachDB until its move to Pebble, a Go engine inspired by RocksDB, and in TiKV, Kafka Streams state stores and MyRocks. InfluxDB and many time-series stores use LSM variants. Nearly every write-heavy database is an LSM engine. See Storage Engines: B-Trees vs LSM Trees.

The LSM-tree, in depth#

Amplification: the three costs. LSM designs trade among three costs. Write amplification is the bytes written to disk per byte of user data: every compaction rewrites data, so with leveled compaction and a size ratio of 10 between levels, a value may be rewritten around 10 times per level it passes through, giving write amplification of tens. Read amplification is the number of places a read must check: the memtable plus potentially one file per level, mostly avoided by Bloom filters. Space amplification is extra disk used by obsolete versions not yet compacted away. Manos Athanassoulis and colleagues framed the general tension as the RUM conjecture (EDBT 2016): an access method can optimise at most two of read, update and memory or space overheads.

Leveled versus tiered compaction. Leveled compaction, used by LevelDB and RocksDB by default, keeps each level as one sorted run of non-overlapping files and merges a file into the next level by rewriting the overlapping files there. Reads are cheap and space overhead is small, around 10%, but write amplification is high. Size-tiered compaction, Cassandra's original default, waits until several files of similar size exist, then merges them into one bigger file. Writes are cheaper, but a key may live in many files, and a large compaction can temporarily need double the space. RocksDB also offers universal compaction, a tiered variant, and Cassandra added leveled, time-window and, more recently, unified compaction strategies.

Deletes are writes. An LSM engine cannot delete in place, because older copies of the key live in older files. A delete writes a tombstone, which shadows older versions until compaction merges it past them. Workloads that delete a lot, such as queues stored in an LSM table, can make reads scan thousands of tombstones, a well-known Cassandra pitfall.

Why it won. Since the paper, disks changed, but the asymmetry did not disappear: on SSDs, sequential writes are kinder to the flash translation layer and reduce wear, and random small writes still cost more. LSM engines also compress well, because SSTables are immutable sorted blocks, and they make snapshots and backups easy, because files never change once written.

Related ideas. Mendel Rosenblum and John Ousterhout's log-structured file system ("The Design and Implementation of a Log-Structured File System", SOSP 1991, and ACM TOCS 1992) applied the same "write everything sequentially, clean up later" idea to a whole file system, and its segment cleaner is a cousin of compaction. WiscKey (Lanyue Lu and colleagues, FAST 2016) separated keys from values, storing only keys and pointers in the LSM tree to cut write amplification for large values, an idea adopted by several engines, such as BlobDB in RocksDB and Titan in TiKV.

The Google File System (GFS)#

The problem. By the early 2000s, Google's web crawls, indexes and logs were hundreds of terabytes, stored on thousands of cheap commodity machines whose disks, memory and power supplies failed every day. Existing distributed file systems assumed reliable hardware and small files, with POSIX semantics. Google's workloads were different: files of hundreds of megabytes to many gigabytes, written mostly by appending, read mostly in long sequential streams, with high sustained bandwidth mattering far more than low latency.

The paper. Sanjay Ghemawat, Howard Gobioff and Shun-Tak Leung, "The Google File System", SOSP 2003.

The key idea: a single master for metadata, many chunkservers for data.

  • Files are split into 64 MB chunks, each identified by a 64-bit handle and stored as ordinary Linux files on chunkservers. Each chunk is replicated, by default on three chunkservers, chosen across racks.
  • A single master holds all metadata in memory: the namespace, the mapping from files to chunks, and the locations of each chunk's replicas. Metadata is small, under 64 bytes per chunk, so even petabytes of data fit in one machine's RAM, and the master can make smart placement and re-replication decisions with a global view.
  • Clients never read data through the master. A client asks the master which chunkservers hold the chunk it needs, caches the answer, and then reads or writes directly with the chunkservers. The master only handles small metadata requests, so it is not a bandwidth bottleneck.
  • The master logs metadata changes to an operation log, replicated to remote machines, with periodic checkpoints, so it can recover quickly. Chunk locations are not persisted; the master asks chunkservers at startup and through regular heartbeats.

Writes, leases and record append. For each chunk, the master grants a lease, initially 60 seconds, to one replica, the primary, which decides the order of mutations. A client pushes data to all replicas along a chain, each forwarding to the next nearest, to use every machine's network bandwidth, and then asks the primary to commit. The primary assigns a serial order and tells the secondaries to apply it. GFS's signature operation is record append: the client supplies only the data, and GFS appends it atomically at least once at an offset of GFS's choosing, so hundreds of producers can append to the same file concurrently without locking, which suited producer-consumer queues and merged results.

Relaxed consistency, stated honestly. GFS did not promise POSIX semantics. After failures, a region of a file could be inconsistent across replicas, or contain duplicates and padding from retried record appends. Applications coped by writing self-validating, self-identifying records, with checksums and unique IDs, so readers could skip garbage and duplicates. This is an early, explicit example of pushing some consistency work to the application in exchange for simplicity and throughput.

Where it shows up today. HDFS, the Hadoop Distributed File System, is a close open-source re-implementation: the NameNode is the master, DataNodes are chunkservers, and blocks, originally 64 MB and now 128 MB by default, are replicated three ways. Google replaced GFS with Colossus, which distributes the metadata itself, storing it in a Bigtable-like database, removing the single-master limit. The separation of metadata from data, used by object stores such as Amazon S3 and by many distributed file systems such as Ceph, is GFS's lasting architectural lesson. See Object Storage and Blob Storage.

GFS, in depth#

Why a single master worked, and why it stopped working. The single master made the design simple: placement, re-replication after failures, garbage collection of deleted files and load balancing all happen in one place with a global view. Keeping it out of the data path, and having clients cache chunk locations, kept the load small. But as clusters grew, two limits appeared. Memory: more files, and especially many small files, meant more metadata than one machine could hold. And availability: a master failure stopped the file system until it restarted or a replica took over, which shadow masters mitigated only for reads. Sean Quinlan, a GFS lead, described in an ACM Queue interview with Kirk McKusick ("GFS: Evolution on Fast-forward", 2009) how applications such as Gmail, with many small files and latency-sensitive access, stretched GFS beyond its original design, which drove the move to a distributed-master design.

Chunk size trade-offs. Large 64 MB chunks reduce metadata, reduce how often clients contact the master, and let clients keep long-lived connections to chunkservers. But a small file is one chunk, and if many clients read the same small file, such as an executable launched on hundreds of machines, its three replicas become hot spots. GFS handled this by raising the replication factor for such files and staggering application start times.

Failure as the normal case. With thousands of disks, a disk fails somewhere every few days, and machines are lost regularly. The master re-replicates chunks whose replica count falls below target, prioritising chunks that have lost two replicas, and limits re-replication bandwidth so recovery does not overload the cluster. Chunkservers checksum each 64 KB block and verify on read, so silent disk corruption is detected and the block is re-fetched from another replica. Deleting a file just renames it; a background garbage collector reclaims chunks later, which is simpler and safer than synchronous deletion across thousands of machines.

HDFS lineage and evolution. HDFS added NameNode high availability with a standby, and federation with multiple namespaces, addressing GFS's single-master limits in another way. Erasure coding, added in Hadoop 3, cut storage overhead from 200% for three replicas to about 50% for a Reed-Solomon 6 + 3 layout, at the cost of more expensive reconstruction. The same trade-off, replication for hot data, erasure coding for cold, now appears in every large storage system.

MapReduce#

The problem. Google engineers wrote many programs that processed huge data sets: building the inverted index from crawled pages, counting links, summarising logs. Each was conceptually simple, but running it across thousands of machines meant writing code for partitioning the input, scheduling work, handling machine failures, moving intermediate data and combining results. That plumbing obscured the logic and was rewritten for every job.

The paper. Jeffrey Dean and Sanjay Ghemawat, "MapReduce: Simplified Data Processing on Large Clusters", OSDI 2004.

The key idea: two functions, and the framework does the rest. The programmer writes:

  • map(key, value), which takes one input record and emits any number of intermediate key-value pairs. For word count, map takes a document and emits (word, 1) for every word.
  • reduce(key, list of values), which receives all values for one intermediate key and emits the output. For word count, reduce sums the ones for each word.

The framework handles everything else:

  1. Split the input, stored in GFS, into M pieces of typically 16 to 64 MB.
  2. A master assigns map tasks to workers, preferring workers on the machine, or the rack, that already holds that split in GFS, so most input is read from local disk: data locality.
  3. Each map task writes its output to local disk, partitioned into R regions by a partition function, by default hash(key) mod R.
  4. The shuffle: each reduce task fetches its partition from every map task's output, sorts by key, and groups values by key.
  5. Reduce tasks run the reduce function and write output files to GFS, one per reduce task.

An optional combiner runs a partial reduce on each map worker's output before the shuffle, such as summing local word counts, which can cut shuffle traffic by orders of magnitude for associative operations.

Fault tolerance by re-execution. The master pings workers. If a worker fails, its in-progress tasks, and its completed map tasks, whose output lived on its now-lost local disk, are rescheduled elsewhere. Because map and reduce are deterministic functions of their input, re-running a task gives the same result, and output is committed atomically by renaming. Stragglers, machines that are slow because of a bad disk or contention, are handled with backup tasks: near the end of a job, the master launches duplicate copies of the remaining in-progress tasks and takes whichever finishes first. The paper reports that a sort benchmark took 44% longer with backup tasks disabled.

Where it shows up today. Hadoop MapReduce, started by Doug Cutting and Mike Cafarella, and developed at Yahoo!, re-implemented the model on HDFS and launched the big data era. Hive and Pig compiled SQL-like and dataflow languages into MapReduce jobs. Apache Spark replaced the rigid two-stage model with general dataflow graphs over in-memory datasets. Google's own successors, FlumeJava and Dataflow, became Apache Beam. The shuffle, partitioning, locality, re-execution and speculative execution remain central to every batch and stream engine. See Batch vs Stream Processing.

A word count in the MapReduce style, as pseudo-code:

map(docId, text):
  for word in tokenize(text):
    emit(word, 1)
 
combine(word, counts):          # runs on each map worker, before the shuffle
  emit(word, sum(counts))
 
reduce(word, counts):           # all counts for one word, from every map task
  emit(word, sum(counts))
 
partition(word, R):             # which reducer receives this key
  return hash(word) mod R

MapReduce, in depth#

The numbers in the paper. The paper reported runs on a cluster of about 1,800 machines, each with two 2 GHz processors, 4 GB of memory and two 160 GB disks. A grep through 10¹⁰ 100-byte records, about 1 TB, finished in about 150 seconds, and sorting the same terabyte took a little under 15 minutes. It also reported that, within about a year of its introduction, Google had written many hundreds of MapReduce programs, and that the production indexing system had been rewritten as a sequence of MapReduce jobs, making its code much simpler.

What MapReduce got right. It turned distributed computing into functional programming: map and reduce have no side effects, which is exactly what makes re-execution safe. It moved computation to the data instead of the reverse. It assumed failure was normal and made it invisible. And its shuffle, a distributed sort by key, is a universal primitive: joins, group-bys, deduplication and inverted indexes are all shuffles.

What it got wrong, or rather what came next. Every MapReduce job writes its output to the distributed file system, so a pipeline of ten jobs writes and replicates nine sets of intermediate data, and iterative algorithms, such as PageRank or machine learning that loop many times, are slow. Michael Stonebraker and David DeWitt's 2008 critique argued it ignored decades of database lessons such as schemas, indexes and query optimisation. Spark (Matei Zaharia and colleagues, "Resilient Distributed Datasets: A Fault-Tolerant Abstraction for In-Memory Cluster Computing", NSDI 2012) kept the re-execution idea but recorded each dataset's lineage, the operations that produced it, so lost partitions are recomputed rather than replicated, and kept datasets in memory between stages. Dremel (Sergey Melnik and colleagues, VLDB 2010) showed interactive SQL over columnar nested data at scale, leading to BigQuery. The Dataflow Model (Tyler Akidau and colleagues, VLDB 2015) unified batch and streaming with windows, watermarks and triggers.

Skew and the shuffle. The shuffle's weakness is skew: if one key, such as the word "the" or one very popular user, has far more values than others, its reducer runs for hours while the rest finish in minutes. Combiners help for associative aggregations; for joins, systems split hot keys across several reducers with a random salt and combine later. Modern engines, such as Spark's adaptive query execution, detect skewed partitions at run time and split them.

Bigtable#

The problem. Google had many products, such as web indexing, Google Earth, Google Analytics and Personalized Search, each needing to store structured data at the scale of billions of rows and petabytes, with workloads ranging from throughput-heavy batch jobs to latency-sensitive serving. A relational database could not scale that far on commodity machines, and GFS stored files, not records you could look up by key.

The paper. Fay Chang, Jeffrey Dean, Sanjay Ghemawat, Wilson Hsieh, Deborah Wallach, Mike Burrows, Tushar Chandra, Andrew Fikes and Robert Gruber, "Bigtable: A Distributed Storage System for Structured Data", OSDI 2006.

The key idea: a sorted, sparse, multi-dimensional map. A Bigtable is a map indexed by row key, column and timestamp, whose values are uninterpreted byte strings:

(row: string, column: string, time: int64) → string

  • Rows are kept in lexicographic order by key, and a read or write of one row is atomic, however many columns it touches. Choosing row keys so that related data sorts together is the main design tool: the paper's example web table stores pages under reversed host names, such as com.cnn.www, so all pages of a domain are adjacent.
  • Columns are grouped into a small number of column families, declared up front, such as contents and anchor, while the column qualifiers within a family are unlimited and created on the fly, such as anchor:cnnsi.com. A row can have millions of columns, and empty cells cost nothing: the table is sparse.
  • Timestamps keep multiple versions of each cell, with garbage-collection rules such as "keep the last 3 versions" or "keep versions from the last 7 days".

Tablets and tablet servers. A table is split by row range into tablets, each around 100 to 200 MB by default, the unit of distribution and load balancing. Tablet servers each serve many tablets. A master assigns tablets to servers, balances load and handles schema changes, but clients do not send data through it. Tablet locations are found through a three-level hierarchy, like a B-tree: a file in Chubby points to the root tablet, which locates METADATA tablets, which locate user tablets, and clients cache locations.

Storage: the LSM-tree on GFS. Each tablet's data lives in SSTables, immutable sorted files stored in GFS, plus a memtable in memory. Writes go to a commit log in GFS, then to the memtable. When the memtable fills, a minor compaction writes it out as a new SSTable; merging compactions combine a few SSTables; and a major compaction rewrites all of a tablet's SSTables into one, finally purging deleted data. Reads merge the memtable with the SSTables. This is O'Neil's LSM idea, made concrete, and Bigtable's description of memtables, SSTables and compactions became the template for LevelDB, HBase and Cassandra.

Chubby for coordination. Bigtable relies on Chubby to ensure there is one active master, to store the root tablet's location, schema information and access control lists, and to track live tablet servers: each tablet server holds an exclusive lock on a file in a Chubby directory, and if it loses its lock, it stops serving. If Chubby is unavailable for long, Bigtable becomes unavailable, a dependency the paper measured.

Where it shows up today. HBase, an open-source Bigtable on HDFS, with region servers, HMaster and ZooKeeper in place of Chubby. Cassandra, which adopted Bigtable's data model, memtables, SSTables and compaction on top of Dynamo's ring. Google Cloud Bigtable, offered as a service since 2015 with an HBase-compatible API. Apache Accumulo, started at the US National Security Agency, adds cell-level security labels. The sorted, range-partitioned design also underlies Spanner, CockroachDB and TiKV.

Bigtable, in depth#

Refinements that became standard. The paper's "refinements" section reads like a checklist for every later LSM store:

  • Locality groups: column families can be grouped into separate SSTables, so a scan that needs only small metadata columns does not read large page contents, an early form of columnar storage within rows. Locality groups can be declared in-memory for small, hot data.
  • Compression: SSTables are compressed per block, with a two-pass scheme that exploits similar values in nearby rows; the paper reported large compression ratios for the web table, because similar pages from the same host sort together.
  • Bloom filters per SSTable, so reads for missing rows or columns skip most files.
  • Caching: a scan cache of key-value pairs and a block cache of SSTable blocks.
  • A single commit log per tablet server, shared by all its tablets, so writes are batched into fewer GFS appends; recovery sorts the log by tablet so each new server reads only its tablets' entries.
  • Immutability: because SSTables never change, reads need no locking on them, and splitting a tablet is fast, since children can share parent SSTables until compaction.

What Bigtable did not do. It offered only single-row transactions. Applications needing cross-row atomicity had to design around it, and many Google teams found that hard. Percolator (Daniel Peng and Frank Dabek, OSDI 2010) added snapshot-isolation transactions across rows on top of Bigtable, using a timestamp oracle and locks stored in Bigtable columns, to make incremental indexing possible. Megastore (Jason Baker and colleagues, CIDR 2011) added Paxos-replicated, ACID entity groups across data centres. Both were steps on the road to Spanner. Jeff Dean later remarked in talks that not supporting distributed transactions in Bigtable was a mistake he regretted, because so many applications built their own. Treat this as a remembered talk remark rather than a published claim.

Row-key design lessons. Bigtable, HBase and Cassandra all teach the same rule: the row key decides locality and load. Sequential keys, such as timestamps, send every write to the tablet at the end of the range, a hot spot, so designers salt or hash a prefix, or reverse the key. Keys that group related data, such as user#123#order#2026-11-04, make common queries single-range scans. This is the origin of the query-first modelling style used by wide-column stores.

Chubby#

The problem. Google's systems repeatedly needed a few coordination functions: electing a single master for GFS or Bigtable, storing small amounts of critical metadata such as "where is the root tablet", and naming services. Each team could embed Paxos in its own system, but Paxos was hard to implement, and getting a library right in every system was risky.

The paper. Mike Burrows, "The Chubby Lock Service for Loosely-Coupled Distributed Systems", OSDI 2006.

The key idea: offer consensus as a service, with a familiar interface. Instead of a Paxos library, Chubby offered a lock service that looked like a small file system: directories and small files, each of which can be used as a reader-writer lock. A service elects its master by having every candidate try to acquire an exclusive lock on a file, such as /ls/cell/bigtable/master; the winner writes its address into the file, and everyone else reads the file to find the master. Burrows argued that a lock service was easier for developers to adopt than a consensus library, because it fits existing programs, needs no quorum of application servers, and handles publishing the result.

How it works.

  • A Chubby cell is usually five replicas, which use Paxos to elect a master and replicate a database. The master serves all reads and writes, and holds a master lease of a few seconds, renewed through Paxos, during which no other master can be elected.
  • Clients hold a session with the cell, kept alive by KeepAlive messages. Locks and cached data are tied to the session; if a session's lease expires, its locks are released.
  • Coarse-grained locks: Chubby is designed for locks held for hours or days, such as a master role, not for fine-grained locks held for milliseconds, which would overload it.
  • Client caching with invalidation: clients cache file contents and metadata, and the master invalidates caches before a modification completes, so cached reads are consistent. Because most traffic is cache hits, a cell can serve tens of thousands of clients.
  • Events: clients can subscribe to notifications, such as "file contents changed" or "master failed over".
  • Sequencers: a lock holder can obtain a sequencer, an opaque byte string naming the lock and its generation, and pass it to the servers it talks to, which check that it is still current before acting. This guards against a delayed request from a former lock holder, the same idea as a fencing token. For servers that do not check sequencers, Chubby offers a lock-delay: after a lock holder fails, the lock cannot be taken by another client for a period, up to a minute.

An unexpected use. The paper reported that Chubby's most popular use became a name service, as a replacement for DNS within Google: DNS caching relied on time-to-live values, so short TTLs to detect changes quickly caused enormous load, whereas Chubby's invalidation-based caching gave fast, consistent updates.

Where it shows up today. ZooKeeper and etcd fill Chubby's role in open-source systems, used for leader election, configuration and service discovery. Kubernetes stores all cluster state in etcd. The patterns Chubby described, an ephemeral lock as a leadership claim, sessions with leases, cached reads with notifications, and fencing tokens, are standard. See Leader Election and Coordination Services.

Chubby, in depth#

Why five replicas, and why one master. Five replicas tolerate two failures, which allows one machine to be down for maintenance while another fails unexpectedly. Funnelling all requests through the master keeps the semantics simple and lets the master manage caches; scaling comes from caching, proxies and partitioning namespaces across cells, not from serving reads on replicas.

Failover without losing sessions. When a Chubby master fails, a new one is elected, and clients enter a grace period, 45 seconds by default in the paper, during which they keep their sessions alive while trying to find the new master. Applications see a "jeopardy" event, can pause, and usually resume without losing locks. This is a careful piece of design: a master failover should not cause every service in the company to lose its locks and re-elect its own masters.

Lessons about users. The paper is unusually candid about how developers used, and misused, the service. Developers wrote loops that retried opening files without backoff, which caused load storms; some stored large files; and some assumed Chubby was always available, so a Chubby outage cascaded. Google responded with quotas, review of new clients, and proxies. The broader lesson is that a coordination service is shared infrastructure on which everything depends, so its usage must be restricted to small, rare operations, and clients must degrade gracefully when it is unreachable.

Paxos in practice. The companion paper, "Paxos Made Live" (Chandra, Griesemer and Redstone, PODC 2007), describes the engineering inside Chubby's replicas: master leases to serve reads without a Paxos round, snapshots, handling corrupted disks, and extensive randomised testing with injected failures. It is one of the best accounts of turning a consensus algorithm into a reliable service.

ZooKeeper#

The problem. Yahoo! ran many distributed systems that needed coordination, configuration, group membership, leader election and locks, and the open-source world had no Chubby. Building a separate service for each primitive was wasteful, and a lock service alone forced every client to block while waiting for locks.

The paper. Patrick Hunt, Mahadev Konar, Flavio Junqueira and Benjamin Reed, "ZooKeeper: Wait-free Coordination for Internet-scale Systems", USENIX ATC 2010.

The key idea: wait-free primitives from which clients build their own coordination. Instead of locks, ZooKeeper offers a small, file-system-like tree of znodes with a few powerful features, and lets clients build locks, elections, barriers and queues as recipes on top. Its operations never block waiting for other clients, hence wait-free.

  • Znodes form a hierarchical namespace, such as /app/config or /app/workers/w1, each holding a small amount of data, kilobytes at most; the default limit is about 1 MB.
  • Ephemeral znodes are deleted automatically when the session that created them ends. A worker that creates /app/workers/w1 as ephemeral is listed only while it is alive: group membership and liveness for free.
  • Sequential znodes get a monotonically increasing counter appended to their name, such as /app/lock/n-0000000042, giving a total order of requests.
  • Watches let a client ask to be notified once when a znode changes or is deleted, so clients wait for changes without polling.
  • Versioned conditional updates: setData(path, data, version) succeeds only if the version matches, a compare-and-set on which clients build safe read-modify-write.

Ordering guarantees. ZooKeeper guarantees that all writes are linearizable, applied in one global order, and that each client's requests are applied in FIFO order. Reads are served locally by whichever server the client is connected to, so they scale with the number of servers but may be slightly stale; a client that needs the latest value calls sync before reading. This split, linearizable writes and fast local reads, is what lets ZooKeeper handle read-heavy coordination workloads.

Zab. Servers replicate writes with Zab, the ZooKeeper Atomic Broadcast protocol (Flavio Junqueira, Benjamin Reed and Marco Serafini, "Zab: High-Performance Broadcast for Primary-Backup Systems", DSN 2011). A leader assigns each write a zxid, an epoch plus a counter, proposes it to followers, and commits once a majority acknowledges. After a leader failure, a new leader is elected with the most up-to-date history, and it synchronises followers before accepting new writes. Zab is similar to Multi-Paxos and Raft, with a focus on primary-backup ordering: a new leader must deliver every transaction a previous leader may have committed, in order, before its own.

Recipes from the paper.

  • Leader election: each candidate creates an ephemeral sequential znode under /election; the lowest sequence number is the leader; each other candidate watches the znode just before its own, and when that one disappears, rechecks whether it is now the lowest. Watching only the predecessor avoids the herd effect, in which one deletion wakes every waiting client at once.
  • Locks: the same pattern under /lock: the lowest sequential node holds the lock; others watch their predecessor. Read-write locks extend it.
  • Configuration: store config in a znode, have every process read it and set a watch, and re-read on change.
  • Barriers and group membership with ephemeral children.

ZooKeeper, in depth#

Sessions and failure detection. A client's session has a timeout, often 2 to 30 seconds, kept alive by heartbeats to whichever server it is connected to. If the client cannot reach any server within the timeout, the session expires, its ephemeral znodes are deleted, and its watches are dropped. A client that is merely disconnected can reconnect to another server within the timeout and keep its session. Session timeouts are a trade-off: short timeouts detect failures quickly but cause false expirations during long garbage-collection pauses or network blips; long timeouts make failover slow.

Locks are leases, not guarantees. A ZooKeeper lock is held while the session lives. If the lock holder is paused, by a long garbage-collection pause, for example, its session can expire and another client can take the lock while the first still believes it holds it. When it wakes, it may write to a shared resource. ZooKeeper cannot prevent that on its own; the protected resource must check a fencing token, such as the lock znode's zxid or sequence number, and reject stale ones. This is exactly Chubby's sequencer idea.

Storage and performance. Each server keeps the full data tree in memory, logs every write to a transaction log on disk with fsync before acknowledging, and takes periodic fuzzy snapshots. Writes require a majority round trip plus an fsync, so a typical ensemble of 3 or 5 servers handles thousands to tens of thousands of writes per second, while reads, served locally from memory, scale to far higher rates by adding servers, including observers, non-voting replicas that serve reads without slowing writes. A dedicated disk for the transaction log is the classic tuning advice, since fsync latency is the write bottleneck.

Current usage in major distributed systems. ZooKeeper coordinated much of the Hadoop ecosystem for a decade:

  • Apache Kafka used ZooKeeper to store cluster metadata, broker membership, topic configuration and the controller election, until KRaft, a Raft-based metadata quorum inside Kafka itself, replaced it. ZooKeeper mode was deprecated during the 3.x series and removed in Kafka 4.0, released in 2025.
  • Apache HBase uses it for master election, region server liveness and the location of the meta table.
  • HDFS NameNode high availability uses it for automatic failover, through the ZKFailoverController.
  • Apache Solr, in SolrCloud mode, stores cluster state and configuration in it.
  • ClickHouse replication originally used ZooKeeper, and ClickHouse later built ClickHouse Keeper, a Raft-based replacement compatible with the ZooKeeper protocol.

The trend is clear: newer systems either embed Raft for their own metadata, as Kafka, ClickHouse and CockroachDB do, or use etcd, as Kubernetes does.

Alternatives. etcd, a Raft-based key-value store with leases, watches over key ranges and transactions, is the coordination store of Kubernetes. Consul combines Raft-based key-value storage with service discovery and health checking. Cloud services offer managed coordination: DynamoDB conditional writes, or a database row with a lease, can serve simple leader-election needs. Embedded Raft libraries, such as etcd's raft package, hashicorp/raft and Apache Ratis, let a system avoid an external dependency entirely.

Limitations. ZooKeeper is not a database: data per znode is small, the whole tree must fit in memory, and write throughput is bounded by one leader's log. Watches fire once and must be re-registered, and a client can miss intermediate changes between notification and re-read, so clients must read the current state, not rely on events. Operating an ensemble is a real burden: JVM tuning, disk latency, session timeouts and quorum sizing. Many outages blamed on "ZooKeeper" were really clients holding too many watches, writing too much data or reconnecting in storms.

So when should you use ZooKeeper then? When the system already runs it, or for infrastructure that needs exactly its primitives:

  • Smart routing: keeping a consistent, watched map of which server owns which shard, partition or document, so routers send each request to the current owner and learn of changes within seconds. This is how HBase clients find regions and how many sharded services route requests.
  • Certain infrastructure design problems: building your own distributed database, queue or scheduler that needs leader election, membership and a small amount of strongly consistent metadata, where ZooKeeper, or etcd, saves you from implementing consensus.
  • Durable distributed locks: locks that must survive the crash of the lock service's servers and must be correct, not just usually correct, such as a lock guarding a job that must never run twice at once, combined with fencing tokens. A Redis-based lock is faster but weaker, because Redis replication is asynchronous; ZooKeeper's locks are backed by a majority-replicated log.

For an interview design, naming ZooKeeper or etcd for leader election, shard assignment or configuration is right; using it as a general data store or a high-rate queue is wrong. See ZooKeeper and etcd.

Dynamo#

The problem. Amazon's e-commerce platform had services, such as the shopping cart, that had to accept writes always: a customer who cannot add an item to their cart during a network problem is lost revenue. Amazon's experience was that relational databases with strong consistency could not deliver that availability across data centres during failures, and that most of those services only needed primary-key access. They also cared about tail latency, measuring service-level agreements at the 99.9th percentile, not the mean, because the slowest requests often belonged to the most valuable customers, those with the longest histories.

The paper. Giuseppe DeCandia, Deniz Hastorun, Madan Jampani, Gunavardhan Kakulapati, Avinash Lakshman, Alex Pilchin, Swaminathan Sivasubramanian, Peter Vosshall and Werner Vogels, "Dynamo: Amazon's Highly Available Key-value Store", SOSP 2007.

The key idea: an always-writable store that resolves conflicts later. Dynamo gives up strong consistency, and accepts that replicas may diverge, in exchange for always accepting writes. It combines several known techniques into one design, and the paper's table of "problem, technique, advantage" is itself a famous summary:

ProblemTechniqueAdvantage
PartitioningConsistent hashing with virtual nodesIncremental scalability
High availability for writesVector clocks, with reconciliation during readsVersion size is decoupled from update rates
Handling temporary failuresSloppy quorum and hinted handoffAvailability and durability when some replicas are down
Recovering from permanent failuresAnti-entropy using Merkle treesSynchronises divergent replicas in the background
Membership and failure detectionGossip-based membership protocolSymmetry, no centralised registry

How it works.

  • Partitioning by consistent hashing: the hash of each key places it on a ring, and each node owns several ranges, through virtual nodes, so load spreads evenly and adding a node moves only a small fraction of keys. See Consistent Hashing.
  • Replication: each key is stored on the first N distinct nodes clockwise from its position, its preference list, with N typically 3.
  • Quorums: a write succeeds when W replicas acknowledge, and a read waits for R replies. With R + W greater than N, read and write sets overlap, so a read normally sees the latest write; a common setting was N = 3, R = 2, W = 2. Applications could tune R and W, for example W = 1 for writes that must never fail.
  • Sloppy quorums and hinted handoff: if some of a key's preferred nodes are unreachable, the write goes to the next healthy nodes on the ring, with a hint naming the intended owner. When the owner recovers, the hinted data is handed back. Writes succeed even when most preferred replicas are down, at the cost that a subsequent read might not overlap the write.
  • Versioning with vector clocks: each version carries a vector clock. When versions are causally ordered, the newer replaces the older; when they are concurrent, Dynamo keeps both as siblings and returns them all on read, and the application reconciles them, such as by merging two shopping carts, then writes back the merged version.
  • Anti-entropy with Merkle trees: each node keeps a Merkle tree, a tree of hashes, over each key range it holds, so two replicas can compare root hashes and descend only into differing branches to find which keys differ, exchanging very little data when replicas mostly agree.
  • Gossip for membership and failure detection: nodes periodically exchange membership views with random peers, so every node eventually learns the ring, without a central coordinator.

Where it shows up today. Apache Cassandra, created at Facebook by Avinash Lakshman, one of Dynamo's authors, and Prashant Malik, combined Dynamo's ring, replication, hinted handoff, gossip and tunable consistency with Bigtable's data model and storage. Riak, from Basho, was the most faithful open-source Dynamo, with vector clocks, siblings and later CRDTs. Voldemort at LinkedIn was another. ScyllaDB re-implements Cassandra in C++. Amazon DynamoDB, launched in 2012, borrowed the name and some ideas but is a different system: it uses leader-based, Multi-Paxos-replicated partitions and offers strongly consistent reads, as its own 2022 paper describes. See Quorums and Leaderless Replication.

Dynamo, in depth#

Partitioning strategies. The paper describes three strategies it went through. The first assigned random tokens to each virtual node, which made partition ranges uneven and made bootstrapping a new node and rebuilding Merkle trees slow, because ranges changed. The final design divided the hash space into Q equal-sized partitions and assigned partitions to nodes, so partitions never split, their Merkle trees stayed stable, and moving a partition meant copying a file. Fixed partitions are a lesson repeated by many later systems: Riak used a fixed ring size, and many sharded databases pre-split into many more partitions than nodes.

Vector clocks in practice. Vector clocks grow with the number of nodes that coordinate writes for a key. Dynamo bounded them by truncating the oldest entries when the clock exceeded a size threshold, such as 10 entries, accepting that this could rarely make causally related versions look concurrent, which only causes an extra reconciliation. The paper reported that, in a 24-hour sample from the shopping cart service, 99.94% of reads saw exactly one version, so siblings were rare in practice, and the divergent versions were mostly caused by concurrent writers, often automated clients, rather than by failures.

Client-driven versus server-driven coordination. Requests could be routed through a load balancer to any node, which forwards to a coordinator, or a partition-aware client library could send each request directly to a replica in the preference list, saving a hop. The paper reported that client-driven coordination reduced 99.9th-percentile latency noticeably, by tens of milliseconds. Cassandra's token-aware drivers apply the same idea.

The 99.9th percentile. Dynamo's performance target was framed as, for example, a response within 300 ms for 99.9% of requests at a peak load. Designing for the tail drove choices such as write buffering in memory, an option that trades durability for latency, and the client-driven routing above. Amazon's focus on percentiles rather than averages became standard practice; see the tail-latency discussion in Observability.

Leaderless trade-offs today. Dynamo-style stores still offer the strongest write availability, but they push work to the application: conflict handling, read-your-writes, and the understanding that R + W greater than N does not give linearizability under sloppy quorums, concurrent writes or failed writes that partially succeeded. Cassandra resolved conflicts with last-writer-wins timestamps instead of siblings, trading Dynamo's no-lost-writes property for simplicity. Riak kept siblings and added CRDTs. These differences are worth knowing in interviews, because "Dynamo-style" covers a range of semantics. See Conflict Resolution, OT and CRDTs.

Kafka#

The problem. LinkedIn generated huge volumes of log data: page views, clicks, search queries, service metrics and operational events. It needed to deliver them to many consumers, real-time monitoring, search and recommendation systems, and the Hadoop warehouse for offline analysis, at rates of billions of events a day. Traditional message brokers, such as those implementing JMS, focused on per-message delivery guarantees and acknowledgement tracking, kept messages mostly in memory, and slowed down badly when consumers fell behind. Log aggregators of the time, such as Facebook's Scribe, pushed data in batches to files, mostly for offline use.

The paper. Jay Kreps, Neha Narkhede and Jun Rao, "Kafka: a Distributed Messaging System for Log Processing", NetDB workshop, 2011.

The key idea: a message queue is a partitioned, append-only log on disk, read by pulling consumers.

  • A topic is split into partitions. Each partition is an append-only log stored as a sequence of segment files on disk. Producers append messages to the end; each message is identified by its offset, its position in the log.
  • Consumers pull messages from brokers at their own pace, asking for "messages from offset X". The broker does not track which messages each consumer has processed; the consumer tracks its own offset. So the broker keeps almost no per-consumer state, a slow consumer does not slow the broker, and a consumer can rewind and re-read.
  • Messages are retained for a configured time or size, such as 7 days, regardless of whether they have been consumed, so many independent consumers can read the same data, and new consumers can process history.
  • Consumer groups: the partitions of a topic are divided among the consumers in a group, so each partition is read by exactly one consumer in the group, and the group scales by adding consumers, up to the number of partitions. Ordering is guaranteed within a partition.
  • Efficiency: Kafka relies on sequential disk I/O, the operating system's page cache instead of its own cache, batching of messages on the producer, broker and consumer side, and the sendfile system call for zero-copy transfer from the page cache to the network socket.

Where it shows up today. Apache Kafka became the standard backbone for event streaming, change data capture and log aggregation, and Confluent was founded by its creators in 2014. Kafka added replication with in-sync replicas in version 0.8, in 2013, idempotent producers and transactions for exactly-once processing in 0.11, in 2017, Kafka Streams for stream processing, and KRaft to replace ZooKeeper. Apache Pulsar, Redpanda, Amazon Kinesis and Azure Event Hubs all adopt the partitioned-log model. Jay Kreps's essay "The Log: What every software engineer should know about real-time data's unifying abstraction" (2013) generalised the idea: a log is the core of databases, replication and data integration. See Apache Kafka in Practice and Delivery Guarantees: At-Most, At-Least and Exactly-Once.

Kafka, in depth#

Why the design is fast. Appending to a file and reading it sequentially is the fastest thing a disk can do, and modern operating systems aggressively cache recently written file data in memory. Consumers that keep up read data straight from the page cache, never touching the disk; consumers that fall behind read sequentially from disk, which is still efficient. With sendfile, data goes from page cache to network card without being copied into the broker's user space. Batching amortises per-message overhead, and compression applies to whole batches. The original paper reported producer and consumer throughput much higher than ActiveMQ and RabbitMQ in its benchmark setup, which was the original pitch; treat exact figures as specific to that setup.

What the first version lacked. The 2011 paper's Kafka had no replication: a broker failure made its partitions unavailable, and a disk loss lost data. It offered at-least-once delivery, used ZooKeeper for consumer group coordination and offset storage, and left exactly-once to applications. Replication came with leaders and followers per partition, an in-sync replica set of followers that have caught up, and producer acknowledgement settings, acks=0, acks=1 and acks=all, which trade latency for durability. Offsets moved from ZooKeeper into an internal compacted topic, __consumer_offsets.

Log compaction. Besides deleting old segments by time or size, Kafka can compact a topic: keep at least the latest message for each key and discard older ones. A compacted topic acts as a durable, replayable table of the latest state per key, which is how Kafka Streams state stores, the consumer offsets topic and change data capture topics work, and it is the log-table duality at the heart of stream processing.

The design's limits. Partitions are the unit of parallelism and ordering, so a topic's maximum consumer parallelism is its partition count, and changing the partition count reshuffles which key goes to which partition. Very many partitions increase metadata and recovery time, one of the pressures that led to KRaft. Brokers store whole partitions locally, so rebalancing moves data; tiered storage, keeping older segments in object storage, and designs that separate compute from storage, such as Pulsar with BookKeeper, address this. And Kafka is a log, not a work queue: per-message acknowledgement, delayed delivery and priority need extra machinery. Kafka 4.0 added an early-access "queues for Kafka" share-group feature for queue-style consumption.

Spanner#

The problem. Google's advertising backend, F1, ran on a sharded MySQL, which made resharding painful and cross-shard transactions impossible. Many Google teams, as noted under Bigtable, wanted SQL, schemas and transactions across rows and shards, with synchronous replication across data centres for availability, at global scale. Bigtable offered scale without transactions; Megastore offered transactions across data centres with poor write throughput.

The paper. James Corbett, Jeffrey Dean, Michael Epstein, Andrew Fikes, Sanjay Ghemawat, Wilson Hsieh, Sean Quinlan and many colleagues at Google, 26 authors in all, "Spanner: Google's Globally-Distributed Database", OSDI 2012.

The key idea: use time itself, with known uncertainty, to order transactions globally. Spanner gives every transaction a commit timestamp such that if transaction T1 commits before T2 starts, in real time, then T1's timestamp is smaller than T2's. This property, external consistency, equivalent to strict serializability, means the database behaves as if transactions ran one at a time in real-time order, across the whole planet. To make it possible, Spanner needed clocks it could trust to within a known bound.

TrueTime. Google equipped data centres with GPS receivers and atomic clocks as time masters, and built the TrueTime API. Instead of returning a single time, TT.now() returns an interval [earliest, latest] guaranteed to contain the true current time. The interval's half-width, ε, the uncertainty, was typically between about 1 and 7 ms in the paper, averaging around 4 ms, growing between synchronisations as local clocks drift and shrinking when they resynchronise.

Commit wait. When a transaction commits, its leader picks a timestamp s no earlier than TT.now().latest, and then waits until TT.now().earliest is greater than s before making the commit visible and releasing locks. After the wait, s is guaranteed to be in the past everywhere, so any transaction that starts later, anywhere, will get a larger timestamp. The cost is a wait of about 2ε, a few milliseconds, which is overlapped with the Paxos replication the commit needs anyway.

How the rest works.

  • Data is split into ranges, called splits or tablets, each replicated by its own Paxos group across several zones or regions, with a long-lived leader.
  • Within a group, the leader uses two-phase locking for read-write transactions.
  • A transaction spanning groups uses two-phase commit, where each participant is itself a Paxos group, so a coordinator failure does not block the transaction forever, because the coordinator's state is replicated.
  • Read-only transactions and snapshot reads at a timestamp take no locks: they pick a timestamp and read the versions as of that time from any replica that is sufficiently up to date. Most reads are of this kind, so they scale widely without blocking writes.
  • Multi-version storage keeps old versions, enabling consistent snapshot reads, backups and schema changes at a timestamp.

Where it shows up today. Cloud Spanner, available as a Google Cloud service since 2017. F1, Google's ads database, ran on Spanner (Jeff Shute and colleagues, "F1: A Distributed SQL Database That Scales", VLDB 2013). CockroachDB and YugabyteDB follow Spanner's architecture with Raft per range and hybrid logical clocks instead of TrueTime, handling clock uncertainty with a configured maximum offset and uncertainty restarts of reads. TiDB takes a related approach with a central timestamp oracle, following Percolator. The "NewSQL" category of distributed SQL databases is largely Spanner's progeny. See Distributed Transactions: 2PC, Sagas and Outbox and Time, Clocks and Ordering.

Spanner, in depth#

Why commit wait gives external consistency. Suppose T1 commits with timestamp s1, and its commit becomes visible only after TrueTime guarantees that real time has passed s1. If T2 starts after T1's commit is visible, T2's start is in real time after s1, and its leader picks a timestamp s2 at or after TT.now().latest, which is at least the true time, which is after s1. So s2 is greater than s1. The whole argument depends on TrueTime's bound being correct: if a clock drifts beyond ε without TrueTime knowing, the guarantee breaks. That is why Google invested in redundant GPS and atomic time masters, daemons that poll several masters, and evicting machines whose clocks drift beyond bounds.

What it costs. Every read-write transaction pays at least one Paxos round, plus commit wait, plus, if it spans groups, two-phase commit across groups. Within a region, commits take milliseconds to tens of milliseconds; across continents, the Paxos majority round dominates, often 50 to 150 ms. The paper's design pushes applications to keep related data together, using interleaved tables and directories so that a user's rows live in one Paxos group and most transactions touch one group.

Without atomic clocks. CockroachDB's approach shows what changes without TrueTime. Its hybrid logical clocks keep timestamps causal, and a node shuts itself down if it detects that its clock is too far from the others, relative to a configured maximum offset of 500 ms by default. A read that encounters a value with a timestamp inside its uncertainty window, between its own timestamp and its timestamp plus the maximum offset, cannot tell whether that write happened before it, so it restarts at a higher timestamp. This gives serializability and avoids stale reads in practice, but not Spanner's full external consistency for causally unrelated transactions without extra waiting. The cost of weaker clocks becomes occasional read restarts instead of a commit wait.

The CAP view. Eric Brewer, then at Google, wrote "Spanner, TrueTime and the CAP Theorem" (2017), explaining that Spanner is technically a CP system, it chooses consistency during partitions, but that Google's private network and operations make partitions so rare that its availability exceeds five nines in practice, so users can treat it as "effectively CA". The point is that CAP describes behaviour during partitions, and engineering can make those very rare.

Later developments. Google's 2017 SIGMOD paper on Spanner (David Bacon and colleagues, "Spanner: Becoming a SQL System") described its evolution into a full SQL database with a query processor, distributed query execution and range extraction. Amazon Aurora DSQL and other distributed SQL systems announced in the 2020s continue the line, combining precise clock services, now offered by major clouds, with Spanner-like designs.

Key ideas and where they show up today#

The table below is the page in one view: each paper's core idea, the trade-off it chose, and where the idea runs now.

PaperKey ideaTrade-off it choseWhere it shows up today
Paxos (1998)Majorities intersect; numbered proposals adopt any value that may have been chosenSafety always; progress only with a stable leader and timely networkRaft in etcd, Consul, CockroachDB, TiKV, KRaft; Zab in ZooKeeper; Paxos in Chubby and Spanner
LSM-tree (1996)Buffer writes in memory, flush sorted runs, merge in the backgroundFast sequential writes; reads check several files; compaction costsRocksDB, LevelDB, Cassandra, HBase, ScyllaDB, Pebble
GFS (2003)One in-memory metadata master; data in large replicated chunks; clients talk to data nodes directlySimplicity and throughput over POSIX semantics and small-file efficiencyHDFS; Colossus; metadata-data separation in object stores
MapReduce (2004)Map and reduce functions; the framework partitions, shuffles, schedules near data and re-executes on failureSimple programming model over flexibility and latencyHadoop, Hive, Spark, Beam and Dataflow, every shuffle-based engine
Bigtable (2006)A sorted, sparse map of row, column and time; tablets by row range; LSM storage on GFSScale and single-row atomicity over multi-row transactionsHBase, Cassandra's model, Cloud Bigtable, Accumulo
Chubby (2006)Consensus packaged as a lock service and small file system, with sessions and cached readsCoarse locks, low rate, high availabilityZooKeeper, etcd, Consul; leader election everywhere
Dynamo (2007)Consistent hashing, N replicas, tunable R and W, sloppy quorums, hinted handoff, vector clocks, Merkle trees, gossipAlways-writable availability over consistencyCassandra, Riak, Voldemort, ScyllaDB
ZooKeeper (2010)Wait-free znodes, ephemeral and sequential nodes, watches, linearizable writes with local readsRead scalability and simple primitives over write throughput and data sizeHadoop, HBase, Solr, older Kafka; etcd and embedded Raft as successors
Kafka (2011)A partitioned, append-only log on disk; consumers pull and track their own offsetsThroughput, retention and replay over per-message queue featuresKafka, Pulsar, Redpanda, Kinesis, Event Hubs; event sourcing and CDC
Spanner (2012)TrueTime intervals plus commit wait give globally ordered timestamps; Paxos groups with 2PCExternal consistency at the price of commit latency and special clocksCloud Spanner, CockroachDB, YugabyteDB, TiDB, Aurora DSQL

Several ideas recur across the table, and they are the real lessons:

  • Separate the control plane from the data plane: GFS's master, Bigtable's master, Kafka's controller and Spanner's placement driver manage metadata, while data flows directly between clients and storage nodes.
  • Make files immutable: SSTables, GFS chunks after writing, Kafka segments, so caching, replication, compression and snapshots become easy.
  • Replicate a log, and derive state from it: Paxos and Raft logs, Bigtable's commit log, Kafka itself, Spanner's Paxos groups.
  • Assume failure is normal: re-execution in MapReduce, re-replication in GFS, hinted handoff in Dynamo, sessions and leases in Chubby and ZooKeeper.
  • Choose a consistency point deliberately: Dynamo chose availability, Spanner chose consistency, and both explained exactly what that cost.
  • Partition everything: tablets, chunks, Kafka partitions, Dynamo's ring and Spanner's splits are all units of distribution, replication and load balancing.

The wider canon#

The ten papers above are the core, but a handful of others are cited so often that they belong in any engineer's vocabulary.

  • "Time, Clocks, and the Ordering of Events in a Distributed System", Leslie Lamport, CACM 1978. Defined the happened-before relation and logical clocks, and introduced the state-machine approach: replicas that apply the same commands in the same order end in the same state. Everything about ordering on this site, and every replicated log, builds on it. See Time, Clocks and Ordering.
  • FLP impossibility, Michael Fischer, Nancy Lynch and Michael Paterson, JACM 1985. No deterministic consensus algorithm can guarantee termination in an asynchronous system if even one process may crash. Practical systems escape by assuming partial synchrony, using timeouts, or randomisation.
  • "Distributed Snapshots: Determining Global States of Distributed Systems", K. Mani Chandy and Leslie Lamport, ACM TOCS 1985. A consistent global snapshot taken with marker messages, without stopping the system; Apache Flink's checkpointing is based on a variant of it.
  • The CAP theorem: Eric Brewer's conjecture, presented in his PODC 2000 keynote, proved by Seth Gilbert and Nancy Lynch ("Brewer's Conjecture and the Feasibility of Consistent, Available, Partition-Tolerant Web Services", SIGACT News, 2002). During a network partition, a system must choose between consistency, in the linearizable sense, and availability. Daniel Abadi's PACELC formulation (IEEE Computer, 2012) adds that even without partitions, systems trade latency against consistency.
  • Raft, Diego Ongaro and John Ousterhout, USENIX ATC 2014, described above, the consensus algorithm most new systems implement.
  • Dapper, Benjamin Sigelman and colleagues, Google Technical Report, 2010. Distributed tracing with trace and span IDs propagated through RPCs and low sampling rates, the ancestor of Zipkin, Jaeger and OpenTelemetry. See Observability.
  • Borg, Abhishek Verma and colleagues, EuroSys 2015. Google's cluster manager, with lessons that shaped Kubernetes, such as pods, labels and declarative jobs.
  • Amazon Aurora, Alexandre Verbitski and colleagues, SIGMOD 2017. "The log is the database": the database engine ships only redo log records to a distributed storage layer that materialises pages, with six copies across three availability zones and a 4-of-6 write quorum.
  • Scaling Memcache at Facebook, Rajesh Nishtala and colleagues, NSDI 2013, and TAO, Nathan Bronson and colleagues, USENIX ATC 2013. How Facebook served billions of reads a second with look-aside caches, leases against thundering herds and stale sets, regional pools, and a graph-aware write-through cache over MySQL.
  • Calvin, Alexander Thomson and colleagues, SIGMOD 2012. Deterministic transaction scheduling: agree on the order of transactions first, then execute them deterministically on every replica, avoiding two-phase commit.
  • XFaaS, Alireza Sahraei and colleagues, SOSP 2023. Meta's serverless platform, running trillions of function calls a day, which keeps utilisation high by deferring delay-tolerant calls to off-peak times, sharing worker pools across functions and treating the global fleet as one pool.

The wider canon, in depth#

How to read a systems paper. Systems papers follow a pattern, and reading them in a deliberate order saves time:

  1. Abstract and introduction: what problem, what workload, what assumptions. Most papers' design choices follow from the workload described here, such as GFS's large files and appends, or Dynamo's always-writable carts.
  2. Design overview and its diagram: the components and the data path. Note what is centralised and what is not.
  3. The key mechanism: TrueTime and commit wait in Spanner, record append in GFS, the shuffle in MapReduce. Work through one operation step by step.
  4. Failure handling: what happens when each component crashes, is slow, or is partitioned. This is where the real design lives.
  5. Evaluation: what was measured, at what scale, on what hardware. Numbers age; ratios and trends last.
  6. Experience and lessons: often the most valuable section. Chubby's, Dynamo's and Bigtable's lessons sections are classics.
  7. Related work: where the idea came from and what it rejected.

Then ask three questions: what did they give up, what would break if the assumptions changed, and where is this idea in the systems I use?

What the papers' context hides. Each paper describes a system at one moment, for one company's workload, on hardware of its time. GFS assumed large files; Gmail's small files later stressed it. Bigtable assumed single-row transactions were enough; many teams disagreed. Kafka's first version had no replication. Dynamo's application-level reconciliation proved hard for most teams, which is one reason DynamoDB took a different path. Reading the later papers and talks, "Paxos Made Live", "GFS: Evolution on Fast-forward", "Spanner: Becoming a SQL System" and the 2022 DynamoDB paper, shows how designs aged, and is often more instructive than the original.

Papers versus open-source re-implementations. HBase, Cassandra, Hadoop and ZooKeeper were not copies; they reinterpreted the papers for different environments. Cassandra mixed two papers. HDFS kept GFS's single master much longer than Google did. Hadoop MapReduce exposed the model to a whole industry that did not have Google's infrastructure. When a design question mentions one of these systems, the paper explains the original intent, and the project's own documentation explains how it actually behaves today.

When to Use It#

These are ideas rather than a single tool, so "using" them means reaching for the right paper's design when a problem has its shape.

  • You need a small amount of strongly consistent state, such as who is the leader, which node owns which shard, or cluster configuration: use consensus, through etcd, ZooKeeper or an embedded Raft library, following Paxos, Chubby and ZooKeeper.
  • You have a write-heavy workload of inserts and updates far exceeding what random B-tree writes can absorb: pick an LSM-based store, following the LSM-tree and Bigtable.
  • You need writes to succeed during partitions and across regions, and can merge conflicts: a leaderless, Dynamo-style store.
  • You need huge, sorted, sparse tables with range scans by key, such as time series per device or messages per user: a Bigtable-style wide-column store.
  • Many consumers need the same stream of events, with replay: a Kafka-style partitioned log.
  • You need SQL transactions across shards and regions with strong consistency: a Spanner-style distributed SQL database.
  • You need batch processing over terabytes: a MapReduce descendant, usually Spark, on files in distributed or object storage, following GFS and MapReduce.
  • In interviews: whenever you name one of these technologies, the paper's key idea is the justification.

When NOT to Use It#

  • Do not copy Google-scale designs for small systems. A single PostgreSQL server handles thousands of transactions per second and terabytes of data; Spanner's machinery is unnecessary until you genuinely need multi-region writes or horizontal scale.
  • Do not use a coordination service as a database or a queue. ZooKeeper and etcd are for kilobytes of metadata and low write rates.
  • Do not pick a Dynamo-style store when you need transactions or invariants, such as balances or inventory, and do not assume quorum settings give linearizability.
  • Do not reach for raw MapReduce for new batch work; Spark, SQL engines on data lakes, or warehouse SQL are simpler and faster.
  • Do not build a Kafka-based architecture for a few hundred messages a minute between two services; a simple queue or a database table is easier to operate.
  • Do not treat a paper as documentation of today's product. Cassandra, Kafka and DynamoDB differ substantially from the papers they descend from.

How to Implement It#

Applying the papers in practice means mapping a requirement to an idea, then to a proven implementation:

  1. State the requirement precisely: consistency needed, read and write rates, data size, latency targets, failure tolerance, and geographic spread.
  2. Find the paper whose problem matches: always-writable carts are Dynamo's; global transactions are Spanner's; event streams are Kafka's; leader election is Chubby's and ZooKeeper's.
  3. Note the trade-off it made, and confirm you accept it: Dynamo's conflicts, Spanner's commit latency, Bigtable's single-row atomicity, ZooKeeper's write limits.
  4. Choose the modern descendant that fits your environment, managed if possible.
  5. Check how it differs from the paper: replication in Kafka, LWW in Cassandra, Raft instead of Paxos, hybrid clocks instead of TrueTime.
  6. Design data placement around its partitioning unit: row keys for Bigtable-style stores, partition keys for Dynamo-style and Kafka, interleaved tables or co-located ranges for Spanner-style.
  7. Plan for its failure modes: compaction backlogs, hinted handoff floods, session expirations, consumer lag, clock skew.

The heart of Paxos, a single acceptor, in pseudo-code:

state: promised = 0, acceptedN = 0, acceptedV = null   # all on stable storage
 
on Prepare(n):
  if n > promised:
    promised = n; persist()
    reply Promise(n, acceptedN, acceptedV)   # report any value already accepted
  else:
    reply Reject(promised)
 
on Accept(n, v):
  if n >= promised:
    promised = n; acceptedN = n; acceptedV = v; persist()
    reply Accepted(n, v)
  else:
    reply Reject(promised)
 
proposer, after Promise from a majority:
  v = value with the highest acceptedN among the replies, or my own value
  send Accept(n, v) to the acceptors
  chosen once a majority reply Accepted(n, v)

The two rules that make it safe are visible: an acceptor never goes back on a promise, and a proposer that gets a majority of promises must re-propose the highest value any of them had accepted.

TechnologyFits whenPaper it descends from
etcd, Consul, embedded RaftLeader election, configuration, shard mapsPaxos, Raft, Chubby
ZooKeeperExisting Hadoop, HBase or Solr ecosystems; recipes for locks and membershipZooKeeper, Chubby
RocksDB, LevelDB, PebbleEmbedded write-heavy storage enginesLSM-tree, Bigtable
HDFS, object storage such as S3 and GCSLarge files for batch analyticsGFS
Spark, Beam and Dataflow, HiveBatch and stream processing over large dataMapReduce
HBase, Cloud BigtableSorted wide-column tables, range scans, huge scaleBigtable
Cassandra, ScyllaDB, RiakAlways-writable, multi-region, partition-key accessDynamo, plus Bigtable's model for Cassandra
Kafka, Pulsar, Redpanda, KinesisEvent streaming, CDC, log aggregation, replayKafka
Cloud Spanner, CockroachDB, YugabyteDB, TiDBDistributed SQL with strong consistency across shards and regionsSpanner, Percolator

Trade-offs#

OptionProsConsPick when
Consensus-replicated state, Paxos or RaftLinearizable; survives minority failuresMajority round trip per write; unavailable without a majorityMetadata, coordination, strongly consistent partitions
Leaderless, Dynamo-styleAlways writable; no failover; multi-regionConflicts; weaker guarantees; repair machineryCarts, sessions, user data where availability wins
Single metadata master, GFS-styleSimple global decisions; fast to buildMaster memory and availability limitsModerate-scale storage and control planes
LSM storageFast writes; good compression; immutable filesCompaction cost; read and space amplificationWrite-heavy stores
B-tree storageFast reads; in-place updates; predictableRandom writes; page fragmentationRead-heavy OLTP
Partitioned log, Kafka-styleThroughput; replay; many independent consumersOrdering only per partition; operations; not a work queueEvent streaming and integration
TrueTime-style orderingExternal consistency; lock-free snapshot readsSpecial clocks; commit wait; cross-region latencyGlobal financial or inventory data
Hybrid logical clocksNo special hardwareUncertainty restarts; weaker guarantees without waitsDistributed SQL on ordinary clouds

Common Pitfalls#

  • Confusing Dynamo with DynamoDB. DynamoDB uses leader-based replicated partitions and offers strongly consistent reads; Dynamo was leaderless with vector clocks.
  • Saying "Cassandra is consistent with QUORUM" without the caveats: sloppy quorums, last-writer-wins conflicts and partially failed writes mean it is not linearizable.
  • Citing CAP as "pick two of three": partitions are not optional, so the choice is consistency or availability during a partition, plus the latency trade-off at other times.
  • Assuming the paper describes the product, such as Kafka without replication, or ZooKeeper still being required by Kafka.
  • Believing Spanner "beats CAP": it chooses consistency, and is highly available because partitions are rare on Google's network.
  • Using ZooKeeper or etcd locks without fencing tokens, so a paused former holder corrupts shared state.
  • Treating MapReduce as obsolete and its ideas with it: the shuffle, locality, re-execution and speculative execution are in every modern engine.
  • Underestimating LSM compaction: write amplification, compaction backlogs and tombstones cause many production incidents.
  • Misattributing papers or inventing details in an interview; name only what you are sure of, and explain the idea rather than the citation.

Real-World Examples#

  • Kubernetes stores all cluster state in etcd, a Raft-replicated key-value store, a direct descendant of the Chubby and ZooKeeper line.
  • Apple has spoken publicly about running very large Cassandra deployments, and Netflix has long used Cassandra for multi-region, always-available data, both building on Dynamo's design.
  • Meta's MyRocks put RocksDB, an LSM engine, under MySQL to cut storage use for its user database, as described in its engineering posts and a VLDB 2020 paper.
  • LinkedIn created Kafka and open-sourced it in 2011; it has since become the default event backbone across the industry.
  • Google runs Spanner for services including Ads (F1), and offers it as Cloud Spanner; CockroachDB and YugabyteDB bring the design to ordinary clouds.
  • Yahoo! ran some of the largest early Hadoop clusters, re-implementing GFS and MapReduce as HDFS and Hadoop MapReduce, and created ZooKeeper to coordinate them.
  • Facebook developed Cassandra for inbox search in 2008, combining Dynamo and Bigtable, before open-sourcing it.

In the Interview#

Deep Dive: Assembling a modern distributed database from paper partsShow

Take a typical distributed SQL database, such as CockroachDB or YugabyteDB, and identify where each part comes from.

  • Data placement: the keyspace is sorted and split into ranges of a few hundred megabytes, like Bigtable's tablets. Ranges split when they grow and are rebalanced across nodes, like tablets moving between tablet servers.
  • Replication: each range is a Raft group of three or five replicas, a direct use of the consensus line from Paxos to Raft, with a leaseholder serving consistent reads without a consensus round, like Chubby's master lease.
  • Storage engine: each node stores its replicas in an LSM engine, RocksDB or Pebble for CockroachDB and a RocksDB-based engine for YugabyteDB, following the LSM-tree and Bigtable's memtables, SSTables and compactions.
  • Transactions: multi-range transactions use a form of two-phase commit whose participants are Raft groups, like Spanner, with transaction records and write intents stored in the database itself, like Percolator's locks in Bigtable.
  • Timestamps: hybrid logical clocks with a maximum clock offset and uncertainty restarts, in place of Spanner's TrueTime and commit wait.
  • Metadata: range locations are stored in special ranges, a two-level addressing scheme similar to Bigtable's METADATA tablets, and cached by clients.
  • Membership and failure detection: node liveness through heartbeats and leases, and gossip of cluster information, echoing Dynamo's gossip.
  • Change streams: changefeeds publish row changes to Kafka, completing the loop with the log-based integration Kafka popularised.

Almost nothing in the design is new; the engineering is in combining these ideas correctly and making them fast. Recognising the parts tells you the behaviour: writes cost a Raft round trip, cross-range transactions cost more, clock skew causes read restarts, and LSM compaction affects tail latency.

Deep Dive: Worked numbers that explain the designsShow

GFS master memory. At under 64 bytes of metadata per 64 MB chunk, 1 PB of data in 15.6 million chunks needs about 1 GB of master memory for chunk metadata, plus file-name metadata, which GFS compressed with prefix compression. That is why one master could manage petabytes. But 100 million small files of 1 MB each, the same 100 TB, would need 100 million chunks and file entries, several gigabytes of metadata, and a request load proportional to file count, which is why small files broke the model.

MapReduce's failure maths. With 1,800 machines and a typical machine failure rate of a few per cent a year, a job running for an hour on all of them has a reasonable chance of losing a machine. Rerunning only the lost machine's tasks, perhaps a fraction of a percent of the job, costs seconds to minutes, while restarting the whole job would cost the full hour. Speculative backup tasks attack the larger practical problem: with 1,800 machines, at least a few will be slow, and the job finishes only when the last task does.

Dynamo's quorum latency. With N = 3 and W = 2, a write waits for the second-fastest of three replicas. If each replica's response time has a 99.9th percentile of 50 ms, the second-fastest of three is slow only if two replicas are slow at once, which is far rarer, so quorum writes have better tail latency than waiting for all three. That is one reason W = 2 and R = 2 were the common setting.

ZooKeeper's write ceiling. A write needs the leader to fsync and a majority to fsync. With SSDs, fsync takes perhaps 0.1 to 1 ms, and group commit batches many writes per fsync, so an ensemble sustains thousands to tens of thousands of writes per second. A design that writes a znode per user request at 50,000 requests per second would saturate it, which is why coordination services hold metadata that changes rarely.

Kafka's sequential throughput. A single modern disk or SSD sustains hundreds of megabytes per second of sequential writes. At 1 KB per message, 100 MB/s is 100,000 messages per second per disk, before replication. With three-way replication, every byte is written three times across brokers, and with consumers reading from the page cache, read traffic costs almost no disk I/O. This is why a modest Kafka cluster handles millions of messages per second.

Spanner's commit wait. With an average ε of about 4 ms, commit wait averages about 8 ms, 2ε, but it overlaps the Paxos replication round, which within a region takes a few milliseconds and across regions tens of milliseconds. So for multi-region groups, commit wait adds little on top of the replication latency that any synchronous geo-replicated database would pay anyway.

Deep Dive: How the ideas evolved after the papersShow

From single masters to distributed metadata. GFS, Bigtable and HDFS began with one master; Colossus, HDFS federation and modern object stores distribute metadata, often by storing it in a scalable database, which is itself built on the ideas of the earlier papers. The lesson: centralise first for simplicity, distribute when the master becomes the limit.

From Paxos to Raft to embedded consensus. Chubby offered consensus as a service; ZooKeeper made it open source; Raft made it easy enough to embed. Kafka's KRaft, ClickHouse Keeper and CockroachDB all embed Raft rather than depend on an external coordinator, removing an operational dependency.

From leaderless back towards leaders. Dynamo's leaderless design maximised availability but pushed conflicts to applications. DynamoDB, many Cassandra users with lightweight transactions, and newer databases moved back to leaders per partition with consensus, accepting brief unavailability during failover in exchange for simpler semantics. Leaderless designs remain the right choice for some workloads, but they are no longer the default.

From batch to streams. MapReduce made batch processing over huge datasets routine; Kafka and the Dataflow model made streams the primary representation, with batch as a special case of a bounded stream. The log at the centre of Kafka is the same structure as the commit log in Bigtable and the replicated log in Paxos: the idea that unites the whole page.

From special hardware to cloud services. TrueTime needed GPS and atomic clocks in every data centre. Cloud providers now offer precise time services to customers, such as Amazon Time Sync and Google's public NTP, and newer distributed databases use them to shrink uncertainty windows, bringing Spanner-like guarantees closer to everyone.

Key Takeaways#

  • Paxos: majorities intersect, and proposers adopt any value that may have been chosen; Raft made it practical, and every replicated log descends from it.
  • LSM-tree: buffer writes in memory, write sorted immutable files sequentially, and merge later; it powers RocksDB, Cassandra and HBase.
  • GFS: a single in-memory metadata master with large replicated chunks and direct client-to-data access; it became HDFS and taught metadata-data separation.
  • MapReduce: map, shuffle and reduce with locality, re-execution and backup tasks; its descendants are Hadoop, Spark and Beam.
  • Bigtable: a sorted, sparse map of row, column and time over tablets and LSM storage; it begat HBase and Cassandra's data model.
  • Chubby: consensus offered as a coarse-grained lock and naming service, with sessions, caching and sequencers.
  • ZooKeeper: wait-free znodes, ephemeral and sequential nodes and watches, with linearizable writes and local reads; succeeded in many systems by etcd and embedded Raft.
  • Dynamo: availability first, via consistent hashing, tunable quorums, hinted handoff, vector clocks, Merkle trees and gossip; it begat Cassandra and Riak, not DynamoDB's internals.
  • Kafka: a partitioned append-only log with pull consumers and retention, now the industry's event backbone.
  • Spanner: TrueTime and commit wait give external consistency for global transactions; CockroachDB and YugabyteDB approximate it with hybrid clocks.
  • Learn each paper's problem, key idea and trade-off, and you can recognise, and justify, almost any modern distributed system.