An embedded key/value database for Go, offering a simple, fast, and reliable storage solution without a full database server.
bbolt is a pure Go embedded key/value database, forked from Bolt to provide an actively maintained version for the Go community. It stores data in a single file on disk and provides ACID transactions, making it suitable for applications that need persistent storage without running a separate database server. It focuses on simplicity, speed, and reliability for read-heavy and sequential write workloads.
Go developers building applications that require lightweight, embedded persistent storage, such as CLI tools, mobile apps (via gomobile), or services where a standalone database server like PostgreSQL would be overkill. It's also used in production environments by companies like Shopify and Heroku for high-load services.
Developers choose bbolt for its minimal API, zero external dependencies, and fully serializable ACID transactions in a single-file format. Unlike alternatives like LevelDB or RocksDB, it offers compare-and-swap operations and a simple B+tree structure optimized for read performance and range scans, with active maintenance and bug fixes from the etcd-io team.
An embedded key/value database for Go.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Written entirely in Go, it integrates seamlessly into Go applications without external dependencies, simplifying deployment and cross-platform use.
Supports fully serializable ACID transactions with compare-and-swap operations, ensuring data consistency for critical production workloads, as highlighted in the features.
Stores all data in a single file on disk, making backups, deployment, and management straightforward, with hot backups possible via Tx.WriteTo().
Read-only transactions return direct references to memory-mapped data, minimizing allocation overhead and boosting performance for read-heavy workloads.
As an active fork of Bolt, it includes bug fixes, performance enhancements, and backwards compatibility, providing long-term reliability for the Go community.
The B+tree structure makes random writes slower than reads; the README admits this and recommends batch transactions or a write-ahead log as mitigations.
Only one read-write transaction can occur at a time due to an exclusive lock, bottlenecking write-heavy concurrent applications and complicating multi-goroutine designs.
Deleting data does not reduce file size; free pages are reused internally but disk space isn't freed, which can waste storage for datasets that shrink over time.
On Linux with ext4 fast commit enabled, bbolt can experience data corruption, requiring specific kernel patches (e.g., 5.10.94+), as detailed in the Known Issues section.