B-Tree vs LSM-Tree: Why InnoDB and RocksDB Make Different Trade-offs
InnoDB uses B-Tree. RocksDB uses LSM-Tree. The choice determines read speed, write speed, and space amplification. Understanding both unlocks every storage engine decision.
Latest articles, tutorials, and deep dives from ndlab tech blog.
InnoDB uses B-Tree. RocksDB uses LSM-Tree. The choice determines read speed, write speed, and space amplification. Understanding both unlocks every storage engine decision.
Every query you write becomes disk I/O. Understanding how databases store data — pages, heap files, row vs column layout — explains why some queries are fast and others are not.
Normalization keeps data consistent. Denormalization makes reads fast. Every real schema is a trade-off between them — this post teaches you how to make that call deliberately.
A slow query in production is a fire. EXPLAIN plans show exactly where the database wastes time — if you know how to read them. This post teaches you how, with real examples.
Window functions and CTEs turn 20-line subquery nightmares into clean SQL. Master ROW_NUMBER, RANK, LAG/LEAD, recursive CTEs, and the patterns that appear in real codebases.
Race conditions in databases are silent and devastating. This post explains ACID, all four isolation levels, and the concurrency bugs each level prevents — with examples.
Results