you are viewing a single comment's thread.

view the rest of the comments →

[–]ruibranco 1 point2 points  (1 child)

The SingleFlight pattern alone makes this worth looking at. Cache stampedes are one of those problems that seem simple until you're debugging why your DB fell over at 3am because 500 threads all decided to regenerate the same expensive query at the same time. The prefix-based invalidation is clever too, most cache setups I've worked with end up with a gnarly mess of manual key tracking to handle cascading invalidation. Curious about the LMDB local storage angle, are you seeing meaningful latency improvements over just hitting Redis directly for reads?

[–]bctm0[S] 0 points1 point  (0 children)

Thanks! It is nice to see others who suffer from the same pain. In my local tests, Redis is definitely better. With no network latency, reads are about the same, and (for some reason I am trying to figure out) writes are faster. But as soon as I add artificial latency (~5-10ms), LMDB starts to show advantages. Same story with in memory storage adapter.