Analyzing the codebase of Caffeine: a high performance caching library

Recently on reddit, the S3 FIFO method has grabbed the attention of notable companies like RedPandas, Rising Wave, and Cloudflare. Intrigued, I delved into understanding Caffeine, a high-performance caching library used in impactful projects like Kafka, Solr, and Cassandra. Caffeine’s clever eviction policy, Window TinyLFU, combines recency and frequency signals for a high hit rate and O(1) time complexity. The FrequencySketch class efficiently tracks access frequency, using a CountMinSketch data structure. Caffeine’s unique implementation details, like its order queues and hierarchical TimerWheel, ensure efficient caching mechanisms. Join me in dissecting Caffeine’s inner workings for practical insights into this widely used cache system.

https://adriacabeza.github.io/2024/07/12/caffeine-cache.html

To top