News for hackers. Stuff that matters.
Re:Cache Concurrency Control by jwahba on Thursday May 30, 2019 @09:07PM (#20057470)
For patterns like this I like to reach for request coalescing. Here's an example of a package that does it in the golang standard lib https://godoc.org/golang.org/x/sync/singleflight
Re:Cache Concurrency Control by regecks on Thursday May 30, 2019 @10:53PM (#20057906)
Big fan of request coalescing, was introduced to it by Varnish. Really helps when a cache entry drops.

I believe what the article did is called a "grace period".

Are there any open implementations of distributed request coalescing? Pretty easy to do using a service proxy, but what about something like a Raft cluster?

Re:Cache Concurrency Control by tyingq on Friday May 31, 2019 @09:12AM (#20060506)
I'm curious if assigning a random value from an acceptable range for the expiry time is a common approach. I assume that wouldn't work for all cases, but might spread the avalanche for some.

Google searches on this topic (random expiry to mitigate an avalanche cache refresh) turn up very little.

Re:Cache Concurrency Control by NovaX on Friday May 31, 2019 @01:46PM (#20063216)
It is very common and often referred to as jitter.

A variation, called scaled ttl, was nicely discussed in this video. https://www.youtube.com/watch?v=kxMKnx__uso