You have a fixed memory budget for Bloom filters across all levels of an LSM tree. Should every level get the same bits per key?
Sketch your own answer first, then compare it with the one below.
A strong answer
No. A miss that reaches a level costs about one read per false positive at that level. A false positive at a small upper level costs the same as one at the huge bottom level, but the bottom level holds most of the keys and so uses most of the filter memory at a uniform rate.
Giving the upper levels more bits per key, and the largest level fewer, lowers the total expected wasted reads for the same memory. The expected cost of a miss is the sum of the false positive rates over all runs, and moving bits to where each bit removes more of that sum helps.
A good answer states the objective as the sum of the rates, notes the uniform setting is not optimal, and mentions that the gain grows with the number of levels.
Sources
- Niv Dayan, Manos Athanassoulis, Stratos Idreos (2017). Monkey: Optimal Navigable Key-Value Store.