2 ms·
With LSM (leveldb, rocksdb) its just a different tradeoff. LSM Write are faster than b-tree (half write amplification) while B-tree read are faster than LSM.
by skyde 5y ago
With LSM (leveldb, rocksdb) its just a different tradeoff.
LSM Write are faster than b-tree (half write amplification)
while B-tree read are faster than LSM.
Reason is because with a warm cache B-tree requires at most one disk read per query since internal nodes will be in cache but for LSM you need one Read per Level.
This advantage disappear if you don't have enough memory to cache all internal nodes.
Another advantage with LSM is it only does half the space amplification as a B-tree.
This is because all level except the top level contain long run of sorted data that compress very well. In a b-tree page are small and most page are not full and you need to store metadata in each page.