In this lesson · topic 3 of 7
Topic 3
Run leveled and tiered on the same writes
8 min read
Same writes, two policies
The lab sends 100 writes a tick into a memtable of 200 entries. The bars show the sorted files on disk by level. Below them are write, read and space amplification, and two charts that follow them as the store grows.
Leveled compaction keeps one file per level, and each level is a multiple of the one above. Tiered compaction lets several files of a similar size gather, then merges them all. The size ratio sets the multiple, or how many files gather.
Predict before you press play
Things to try
- Read the three numbers with leveled compaction, then switch to tiered.
- With tiered, raise the ratio from 4 to 8.
- Cut distinct keys to 2000 and compare space amplification under each policy.
- Under leveled, raise the ratio and watch the number of levels fall.
- Watch the runs chart. Tiered saws up and down as merges happen. Leveled stays low.
The full-page lab also has guided experiments.