So the single L1 sstable we are compacting will overlap around 10 of the L2 sstables. This dramatically reduces the influence of WA cycles. If that happens, we pick one sstable from L1 and compact it into L2: A single sstable in L1 is part of a run of 10 files.
LCS does not have the temporary disk space problem which plagued STCS: While STCS may need to do huge compactions and temporarily have both input and output on disk, LCS always does small compaction steps, involving roughly 11 input and output sstables of a fixed size.
An SSD with a low write amplification will not need to write as much data and can therefore be finished writing sooner than a drive with a high write amplification.
In a perfect scenario, this would enable every block to be written to its maximum life so they all fail at the same time. Therefore, separating the data will enable static data to stay at rest and if it never gets rewritten it will have the lowest possible write amplification for that data.
The result is the SSD will have more free space enabling lower write amplification and higher performance. The key is to find an optimum algorithm which maximizes them both. In the previous postwe introduced the Size-Tiered compaction strategy STCS and discussed its most significant drawback — its disk-space waste, a.
We end up writing the same data to disk over-and-over many more times than STCS did, which in many mixed read-write workloads can cause the disk to not be able to keep up, and both write and read performance can suffer.
This happens when the last level is not filled, but rather only filled as much as the previous level. For such workloads, LCS will have terrible performance, and not be a reasonable choice at all however, do note that above we saw that some specific types of workloads, those mostly overwriting recently-written data, have low write-amplification in LCS.
It then finds the roughly 10 sstables in the next higher level which overlap with this sstable, and compacts them against the one input sstable.
This is no longer true for modern hard disk drives, which now identify bad sectors and use metadata to remap data to replacement sectors.