Readit News logoReadit News
bnkamalesh commented on Show HN: Public chat rooms with ephemeral chat and anonymous signup   phispr.space/... · Posted by u/bnkamalesh
raxxorraxor · 4 months ago
I guess when services are forced to use id checks/age verification (same thing really), it is nice to have fallbacks like this. Good work!
bnkamalesh · 4 months ago
haha yea, it's just a coincidence that I built it during this time. Otherwise not a rebel platform, I can't be arsed with governments. In the event of legal issues, I'll simply shutdown and I would literally be unable to provide any logs, chat etc.
bnkamalesh commented on Show HN: Pocache, preemptive optimistic caching for Go   github.com/naughtygopher/... · Posted by u/bnkamalesh
indulona · a year ago
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.
bnkamalesh · a year ago
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 strategy itself rather than the cache eviction or storage mechanisms. Hence the store is configurable for Pocache.
bnkamalesh commented on Show HN: Pocache, preemptive optimistic caching for Go   github.com/naughtygopher/... · Posted by u/bnkamalesh
bww · a year ago
You 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 same key make one fetch between them and share the same result.

https://github.com/golang/groupcache?tab=readme-ov-file#load...

bnkamalesh · a year ago
hey thank you for sharing this. Based on what I understand, this package focuses on the underlying storage mechanism itself rather than helping with the cache strategy. It seems like a solid storage extension which can be used Pocache!
bnkamalesh commented on Show HN: Pocache, preemptive optimistic caching for Go   github.com/naughtygopher/... · Posted by u/bnkamalesh
serialx · a year ago
PSA: You can also use singleflight[1] to solve the problem. This prevents the thundering herd problem. Pocache is an interesting/alternative way to solve thundering herd indeed!

[1]: https://pkg.go.dev/golang.org/x/sync/singleflight

bnkamalesh · a year ago
thank you for the recommendation, was a good read as well. I could even use it to replace how I'm handling the call suppression/debounce mechanism. Though I think Pocache does 1 extra thing, which is to keep the cache updated before it expires, i.e. for keys which are frequently fetched it'd serve up to date data always from the cache. If we only relied on call suppression, then the concurrent requests would just have to wait during the update stage, or the read-through mechanism would keep hitting the main database.
bnkamalesh commented on Show HN: Pocache, preemptive optimistic caching for Go   github.com/naughtygopher/... · Posted by u/bnkamalesh
NovaX · a year ago
One optimization for background refresh is coalescing the individual reloads into a batch operation based on a time/space window. Here is how we do it in the Java world. [1]

[1] https://github.com/ben-manes/caffeine/tree/master/examples/c...

bnkamalesh · a year ago
aha yes! It's in my todo list to introduce bulk updates. On the other hand, I'll be publishing a batcher package soon which does something very close to what you suggested here. Thank you

u/bnkamalesh

KarmaCake day53March 12, 2018
About
https://kamaleshwar.com
View Original