4 ms·
Have a look at, also in Go written, https://github.com/dgraph-io/ristretto https://github.com/dgraph-io/ristretto which out performs bigcache and freecache (see
by cyri 7y ago
Have a look at, also in Go written, https://github.com/dgraph-io/ristretto https://github.com/dgraph-io/ristretto which out performs bigcache and freecache (see the colourful graphics)
- SergeAx 7y agoAlas, Ristretto implements an eventual consistency.
- mrjn 7y agoFeel free to file an issue if that's a concern -- if enough people feel the same way we could provide an option to "synchronous consistency". It wasn't one in the use cases we looked at.
- SergeAx 7y agoIt would be a significant performance tradeoff, if I understand correctly. So there's no point, there are enough ACID in-memory databases in the world)
- mrjn 7y agoMost likely not a performance tradeoff. For every Get and Set, we do lookups anyway. Caffeine, for comparison, always sets the key-value, and then if the key doesn't get admitted due to policy, deletes it later.
- mrjn 7y ago(author of Ristretto here) Yeah, I'm surprised not enough people here are talking about Ristretto. It was actually designed with knowledge of the existing Go caches, to deal with their limitations -- based on multiple papers and Caffeine [1], popular in Java world. In particular, achieving higher hit ratios while avoiding contention caused by heavy concurrent access. This is worth a read: https://blog.dgraph.io/post/introducing-ristretto-high-perf-go-cache/ https://blog.dgraph.io/post/introducing-ristretto-high-perf-... [1]: https://github.com/ben-manes/caffeine https://github.com/ben-manes/caffeine