distcache: a groupcache-style distributed cache in Go built as a learning project
A developer has built distcache, a groupcache-inspired distributed read-through cache written in Go using only the standard library. The design assigns each key a single owner node, which other nodes query over HTTP instead of hitting the database directly. It is composed of four small packages covering consistent hashing with virtual nodes, singleflight request collapsing, an LRU cache, and the top-level pool and group logic. To address stampedes and hot keys, concurrent loads are collapsed into one backend call and popular values are sampled into a small hot cache. The cache is fill-only, with no Set or Delete, which avoids invalidation complexity for data that never changes under a given key.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in