// the find
tidwall/buntdb
BuntDB is an embeddable, in-memory key/value database for Go with custom indexing and geospatial support
BuntDB is a single-file, in-memory key/value store for Go that persists via an append-only log. It's aimed at small Go programs that need a zero-dependency embedded database — think config, session storage, or a local cache — without standing up Redis or SQLite.
The spatial indexing via R-tree is genuinely useful and rare in embedded stores — you can do geofence queries in a few lines without pulling in a separate library. JSON field indexing through GJSON means you can sort and range-query over document fields without a separate schema definition. The transaction model is clean: readers don't block writers and vice versa, which is a solid choice for an embedded store. The AOF shrink runs without locking the database, which is a detail most toy databases get wrong.
You cannot delete keys during iteration — you have to collect them and delete after, which is a footgun that shows up in real code and isn't mentioned until buried in the README. There's no query language; you compose index lookups manually, so anything beyond range scans over pre-declared indexes requires pulling everything out and filtering in Go. The benchmarks are from a 2015 MacBook Pro and haven't been refreshed in years, so treat SET at 248k ops/sec with skepticism on modern hardware under real workloads. The data model is pure string keys and string values, so you're serializing everything yourself — fine for small projects, but it shifts complexity to the caller when values get structured.