B-Tree / B+tree Storage Versus LSM Tree
TradeoffDatabase InternalsMidSeniorUpdated
Storage engine for a write-heavy time-series ingest service. Reads are mostly recent data; durability matters; SSDs.
Short answer: LSM tree (RocksDB, Cassandra style). LSM converts random writes into sequential SSTable flushes plus background compaction, which is a much better fit for write-heavy ingest.
The Two Options
A
B-tree / B+tree storage (Postgres, InnoDB style)
B
LSM tree (RocksDB, Cassandra style)
Drill This: Your Pick First
The Better Pick
Option B
LSM tree (RocksDB, Cassandra style)
LSM converts random writes into sequential SSTable flushes plus background compaction, which is a much better fit for write-heavy ingest. Reads of recent data hit the memtable and L0, so read amplification stays modest.
When the Other One Wins
B-tree / B+tree storage (Postgres, InnoDB style)
Mixed OLTP with heavy in-place updates to the same rows and strict read latency SLOs favor B-trees. LSM read amp and compaction stalls become liabilities.