Advanced35 min readยท Topic 10.2

Distributed storage systems

Amazon Dynamo, Google Bigtable, Google Spanner, Facebook TAO, Cassandra deep dive

๐Ÿ“ฆKey Takeaways

  • 1
    Dynamo (Amazon): leaderless, eventual consistency, consistent hashing, vector clocks โ€” inspired DynamoDB, Riak, Cassandra
  • 2
    Bigtable (Google): sorted string table, column-family store โ€” inspired HBase, Cassandra's data model
  • 3
    Spanner (Google): globally distributed, strongly consistent via TrueTime โ€” first 'NewSQL' database
  • 4
    Each system makes different trade-offs on the CAP spectrum based on its primary use case

Papers That Shaped Modern Databases

Three seminal papers from Amazon and Google defined the design space for distributed storage: Dynamo (2007), Bigtable (2006), and Spanner (2012). Understanding these systems means understanding the trade-offs behind DynamoDB, Cassandra, HBase, CockroachDB, and most modern distributed databases.

Landmark Systems Compared

SystemConsistencyModelKey InnovationInspired
DynamoEventual (tunable)Key-value, leaderlessConsistent hashing, vector clocks, sloppy quorumDynamoDB, Riak, Cassandra
BigtableStrong (single-row)Column-family, sortedSSTable/LSM tree, tablet serversHBase, Cassandra data model
SpannerStrong (global)Relational, distributedTrueTime (GPS + atomic clocks), 2PC at global scaleCockroachDB, YugabyteDB

System Deep Dives

Key insight: for Amazon's shopping cart, availability > consistency. It's better to show a stale cart than an error.

Techniques: Consistent hashing (data partitioning), vector clocks (conflict detection), sloppy quorum (R+W>N for tunable consistency), hinted handoff (availability during failures).

DynamoDB is the commercial evolution โ€” managed, with stronger consistency options, but same philosophical DNA.

Designed for petabyte-scale structured data at Google (web indexing, Google Earth, Google Finance).

Architecture: Tablet servers store row ranges. Data stored as SSTables (sorted string tables) in GFS. Master assigns tablets to servers.

Influenced the entire NoSQL movement: HBase is an open-source clone; Cassandra borrowed the data model.

The 'impossible' database: globally distributed AND strongly consistent.

Key innovation: TrueTime API provides bounded clock uncertainty (~7ms) using GPS and atomic clocks in every datacenter.

Commit protocol: acquire locks, get TrueTime timestamp, wait out the uncertainty interval, then release. Guarantees linearizability.

CockroachDB and YugabyteDB are open-source Spanner-inspired databases (using HLC instead of TrueTime).

Advantages

  • โ€ขDynamo's techniques are widely applicable
  • โ€ขSpanner proved global strong consistency is possible
  • โ€ขUnderstanding these papers explains all modern distributed DBs

Disadvantages

  • โ€ขTrueTime requires specialized hardware
  • โ€ขDynamo's eventual consistency creates application complexity
  • โ€ขEach system optimizes for specific workloads

๐Ÿงช Test Your Understanding

Knowledge Check1/1

What is Spanner's key innovation for achieving global strong consistency?