Definition
Background merging of an LSM-tree's sorted files to reclaim space and keep reads fast.
How it works
LSM writes pile up as immutable sorted files (SSTables); compaction merges them, drops overwritten values and tombstones, and limits how many files a read must check (read amplification). It's essential but costly — it competes with live traffic for disk I/O, so tuning compaction is a big part of operating Cassandra/RocksDB.
Common questions
What is Compaction?
Background merging of an LSM-tree's sorted files to reclaim space and keep reads fast.
How does Compaction work?
LSM writes pile up as immutable sorted files (SSTables); compaction merges them, drops overwritten values and tombstones, and limits how many files a read must check (read amplification). It's essential but costly — it competes with live traffic for disk I/O, so tuning…
What is Compaction used for in system design?
LSM writes pile up as immutable sorted files (SSTables); compaction merges them, drops overwritten values and tombstones, and limits how many files a read must check (read amplification). It's essential but costly — it competes with live traffic for disk I/O, so tuning…