My LSM Tree Was Slower Than a B-Tree. Then I Profiled It.
A few weeks ago I wanted to understand how the storage engine inside RocksDB actually works. Not read about it. Build it.RocksDB, LevelDB, Cassandra, TiKV, CockroachDB — they all sit on top of the same idea: the log-structured merge tree. Every backend engineer has used a database built on an LSM tree. Almost none of us have read one we could actually understand, because the production ones are hundreds of thousands of lines.So I built one in Go. Then I benchmarked it and it was embarrassingly s...
Read more at medium.com