Define write, read and space amplification for an LSM tree, and say why you cannot minimise all three.
Sketch your own answer first, then compare it with the one below.
A strong answer
Write amplification is the bytes written to disk per byte the application wrote, mostly from compaction rewriting data. Read amplification is the number of files, or the amount of data, a read must examine. Space amplification is the bytes stored per byte of live data, caused by old versions that have not been merged away.
They pull against each other. Merging more eagerly keeps few files and few old versions, so reads and space are good, and the data is rewritten many times. Merging lazily saves write work, and leaves more files and more stale data.
A good answer says that the compaction policy is a choice of which cost to pay, based on the workload.
Sources
- Niv Dayan, Stratos Idreos (2018). Dostoevsky: Better Space-Time Trade-Offs for LSM-Tree Based Key-Value Stores via Adaptive Removal of Superfluous Merging.
- Chen Luo, Michael J. Carey (2020). LSM-based storage techniques: a survey.