Database / ScyllaDB Interview questions
What happens internally when ScyllaDB performs compaction?
Compaction reads several existing SSTables, merges their contents row by row, and writes the result as new, consolidated SSTables, all while the affected data remains readable and writable through the process.
For each partition present in the input SSTables, compaction merges all the row fragments it finds, keeping the most recent value for each column based on write timestamps, and applying any tombstones so deleted data doesn't reappear. Data that's past both its TTL and gc_grace_seconds is dropped entirely rather than rewritten. Once the new SSTable (or SSTables, for LCS which produces multiple leveled outputs) is fully written and fsynced, the old input SSTables are deleted. Because compaction is CPU and I/O intensive, ScyllaDB throttles it via configurable bandwidth limits and prioritizes foreground read/write traffic, so compaction runs continuously in the background without starving the workload it's supporting.
More Related questions...