All Questions
Database Indexing hard

Log-Structured Merge (LSM) Trees (RocksDB, Cassandra) optimize for Write Throughput. How does their disk IO pattern differ from B-Trees?

  1. A LSMs buffer writes in an in-memory MemTable and then flush them to disk as immutable, sorted SSTables to ensure sequential I/O patterns.
  2. B LSMs utilize a sophisticated random-access write protocol that directly modifies physical pages in the background to minimize write latency.
  3. C LSMs intentionally disable the Write-Ahead Log (WAL) and rely on the operating system's internal page cache to ensure absolute data durability.
  4. D LSMs store all incoming data in a highly compressed columnar format to maximize the efficiency of analytical queries and batch processing.

One system design question a day, with spaced repetition so the ones you miss come back.

Get the app

Related questions