I have implemented my own SIEVE cache, with TTL support. It solves all these issues and requires no background workers. Author, or anyone else interested in this, should read the SIEVE paper/website and implement their own.
that was an interesting read ( https://junchengyang.com/publication/nsdi24-SIEVE.pdf ), thanks for the recommendation. It looks like a good fit for replacing the underlying storage mechanism of Pocache, instead of the LRU. Though I do not think it addresses the thundering herd problem, where the underlying database would be flooded with calls when the cache expires. I think Pocache is focusing more on the caching str…
Show HN: Pocache, preemptive optimistic caching for Go
31–33 of 33 posts
Re: Show HN: Pocache, preemptive optimistic caching for Go
#32Earlier quoted context omitted.
A non-blocking send would work just as well for that issue, is a standard part of the language, and would support user-supplied channels, but it would still be at risk of panicking when sending to a closed channel. I think there ought to be a safe way to send to a closed channel, but the language authors disagree, so that's not really on the library authors (though they could still recover from the panic). However, n…
Closing the channel is pointless. I don't understand why people get obsessive about closing channels. It's not needed by the garbage collector, it's not good practice. It's explicitly called out in the official go guide as unnecessary most of the time. [0] If you have a channel that is only used a single time and then discarded, closing it is literally just wasting CPU cycles. And definitely not "lazy/rude". [0] http…
Re: Show HN: Pocache, preemptive optimistic caching for Go
#33You may be interested in Groupcache's method for filling caches, it solves the same problem that I believe this project is aimed at. Groupcache has a similar goal of limiting the number of fetches required to fill a cache key to one—regardless of the number of concurrent requests for that key—but it doesn't try to speculatively fetch data, it just coordinates fetching so that all the routines attempting to query the…
Is groupcache suitable for current use? I don't see commits in years and the issues have reports of panics due to bugs.