Column-Family Stores (Cassandra, ScyllaDB, BigTable, SSTables)
Deconstruct massive write engines: Partition Keys vs Clustering Columns, Log-Structured Merge (LSM) Trees, Memtables, CommitLogs, SSTables, Bloom Filters, and Compaction.
01.1. The LSM-Tree Write Pipeline (Why Cassandra Writes are Blistering Fast)
Traditional relational databases use B+ Trees, which require updating data pages in-place on disk. In-place updates force slow, random disk I/O seeks that cap single-node write throughput.
Apache Cassandra and ScyllaDB use a Log-Structured Merge (LSM) Tree architecture that converts ALL write mutations (INSERTs, UPDATEs, and DELETEs) into sequential append-only disk operations:
- CommitLog Append (Sequential Disk I/O): The write is appended sequentially to the on-disk
CommitLogfile to guarantee crash durability (no random seeks). - Memtable Insertion (In-Memory): Simultaneously, the row is inserted into an in-memory sorted data structure called the Memtable (implemented as a concurrent SkipList in RAM).
- Instant Acknowledgment: Once written to both CommitLog and Memtable, the database immediately returns a success response to the client (~1ms) with zero random disk I/O!
- SSTable Flush: When the Memtable fills up (e.g., exceeds 512MB), it is flushed sequentially to disk as an immutable SSTable (Sorted String Table) file.
- Tombstones for Deletions: Deleting a row does not erase data from disk immediately. Cassandra appends a special marker called a Tombstone with a timestamp. The tombstone suppresses older records until background compaction reclaims the disk space.
Apache Cassandra LSM-Tree Write Path, SSTables, & Compaction ð
Apache Cassandra LSM-Tree Write Path, SSTables, & Compaction ð
How Column-Family engines (Cassandra/ScyllaDB) achieve hundreds of thousands of writes/sec via CommitLog sequential appends, in-memory Memtables, immutable SSTables, and Bloom Filter lookups.
Unlock Topic #54: Column-Family Stores (Cassandra, ScyllaDB, BigTable, SSTables)
You are viewing a preview. The full in-depth engineering deep dive, interactive simulators, architecture flowcharts, and self-assessment quizzes for this topic are available with Pro or Lifetime Access.
Failure modes, high-throughput bottlenecks, and real FAANG implementation decisions.
Interactive system topology diagrams, live parameter simulators, and downloadable SVG charts.
Staff-level multiple-choice quiz questions with instant feedback and answer explanations.
Firebase Google authentication automatically syncs your completed topics and quiz scores.
How clear and staff-actionable was this system breakdown?