by mrjn · 7y ago · 0 comments
With guidance from Ben Manes, we're planning to work on a new concurrent Go cache based on Caffeine (Java). If you're interested in helping (or already have something similar), do reach out to us!
Meanwhile, check out Dgraph, our distributed graph database which is what keeps us busy: https://github.com/dgraph-io/dgraph
If it were an on disk cache []byte would likely make sense but given it’s in memory I’m not sure. If you use interface{} you’ll need to measure that cost as well.
When de-serialized, in-memory structs take up more memory on heap and it gets hard to compute that -- we've tried that in vain in the past.
Having said that, there's still a general need to store pointers as values and that's something we'll look at once this byte-based implementation is ready.
If you are just going to send that stuff to nic/disk eventually anyway its perfectly fine (which is why something like Redis which is an out of memory cache can get away with it).
It is a completely lock free key value store, though does not have eviction built in.
Its memory management is done using a free list of blocks, which is part of how it maintains lock free concurrency.