Database / RocksDB Basics Interview Questions
What is Space Amplification?
Space amplification is the ratio between the actual disk space RocksDB's data files consume and the true logical size of the data currently stored.
- Occurs because outdated versions of a key, and tombstones marking deletions, can persist on disk until compaction removes them
- Compaction styles that delay merging more aggressively, like universal compaction, tend to have higher space amplification while that data waits to be cleaned up
- Can be reduced through more frequent or more aggressive compaction, at the cost of increased write amplification
Like the other two amplification metrics, this reflects a genuine trade-off rather than something that can simply be eliminated, tuning RocksDB means choosing which of these costs matters most for a given workload.
More Related questions...