Dragonfly Cache Design
The text discusses the design behind Dragonfly cache, an alternative to Redis' eviction policies. It begins by explaining LRU (Least Recently Used) cache policy and its limitations, particularly in handling traffic fluctuations. The author then delves into Redis' implementation of approximated LRU and highlights its shortcomings. Dragonfly cache is introduced as a novel approach that addresses these issues. It is based on the 2Q algorithm from a 1994 paper, which introduces two independent buffers to consider both recency and access frequency for each item. Dragonfly cache uses Dashtable, a segmented hashtable with weak ordering characteristics, to implement this strategy efficiently. The text provides an overview of how the 2Q algorithm works within the context of Dashtable in Dragonfly's implementation. It explains the promotion and eviction processes for probationary and protected buffers, emphasizing that no additional metadata is needed. The author concludes by expressing gratitude to Ben Manes for his guidance on using caffeine simulator to compare Dragonfly Cache with other caches.
Company
Dragonfly
Date published
June 23, 2022
Author(s)
Roman Gershman
Word count
1507
Hacker News points
None found.
Language
English