Frequency Thresholds and Sharded Eviction: Building CloxCache
tl;dr I tried to write a tiny cache for AtlasDB. Accidentally discovered that protecting items with freq > k from eviction gives near-optimal hit rates. Then discovered that the design scales almost linearly with CPU cores — unlike LRU, TinyLFU, or ClockPro. The whole algorithm is ~500 lines of Go.