6 ms·
I needed a readonly key value system. I ended up building out my own key value store for several million entries using a memory mapped file in Go. The total fi
by tmaly 9y ago
I needed a readonly key value system.
I ended up building out my own key value store for several million entries using a memory mapped file in Go. The total file size is about 17GB.
I originally wanted to use Boltdb for this, but it was taking too long to load, and the author mentioned in a github issue that just using a memory mapped file would be faster.
I use a dictionary of keys to offsets in the memory mapped file to perform my lookup.
My total loading time only takes a few minutes.
If you only need to query on a simple key value, this approach may work for you.