Bolt is an embedded key value database written in pure Go. Rather than running as a separate server like Postgres or MySQL, it lives as a library inside a Go program and stores data in a single file on disk. The README says it was inspired by an existing C database called LMDB and is meant for projects that need a simple, fast, and reliable place to keep data but do not need a full database server. The API is intentionally tiny: get a value, set a value, and not much more. The project status section is important context. Bolt is stable, the API is fixed, and the file format is fixed. It has full unit test coverage and randomised black box testing, and the README mentions companies like Shopify and Heroku running Bolt backed services with databases up to one terabyte in size. However, the original author Ben Johnson posted a message that he no longer has the time and energy to keep maintaining it. He considers the project complete and recommends people who want a more actively developed version look at the CoreOS fork called bbolt. The usage walkthrough starts with installation via go get, which also installs a bolt command line tool. To open a database you call bolt.Open with a filename, file permissions, and options. Bolt takes a file lock so two processes cannot open the same database file at once; you can pass a timeout option so it does not wait forever. All work happens inside transactions. Only one read write transaction can run at a time, but many read only transactions can run in parallel, and each transaction sees a consistent snapshot of the data as of when it started. The README shows how to start a read write transaction with db.Update, a read only transaction with db.View, and a batched form db.Batch that groups concurrent writes from multiple goroutines into fewer disk syncs at the cost of possibly retrying your function. There is also a lower level db.Begin for manual control. The rest of the README, indicated by its table of contents, goes deeper into buckets (named groups of keys), key and value pairs, iteration including prefix and range scans, nested buckets, backups, statistics, a read only mode, mobile use on iOS and Android, comparisons with relational databases and with LevelDB, RocksDB, and LMDB, plus caveats, limitations, and a list of other projects using Bolt.
Generated 2026-05-21 · Model: sonnet-4-6 · Verify against the repo before relying on details.