$ show tidwall/buntdb
BuntDB is a low-level, in-memory, key/value store library in Go. It supports custom indexing (B-tree and R-tree), geospatial queries, JSON indexing, TTL expiration, and ACID transactions with multiple readers / single writer. Persistence is via an append-only file (AOF) with automatic background shrinking. The library is designed for high performance and embeddability, and is used by projects requiring a fast, reliable embedded database. The codebase is a single package with a well-structured API, comprehensive tests, and minimal dependencies.
The LLM identified 1 files worth highlighting for reuse:
The Tx and txWriteContext types implement a robust transaction management pattern with support for rollback, commit, and concurrent read/write isolation. The write context maintains rollback and commit maps, allowing safe modification of the database within a transaction while preserving the ability to revert changes. This pattern is reusable in any Go project requiring transactional semantics on a data structure, and demonstrates clean separation of concerns.