Bolt is a pure Go key/value store inspired by Howard Chu's LMDB project. The goal of the project is to provide a simple, fast, and reliable database for projects that don't require a full database server such as Postgres or MySQL. Since Bolt is meant to be used as such a low-level piece of functionality, simplicity is key. The API will be small and only focus on getting values and setting values. That's it. Bolt is stable, the API is fixed, and the file format is fixed. Full unit test coverage and randomized black box testing are used to ensure database consistency and thread safety. Bolt is currently used in high-load production environments serving databases as large as 1TB. Many companies such as Shopify and Heroku use Bolt-backed services every day. Please note that Bolt obtains a file lock on the data file so multiple processes cannot open the same database at the same time.
Features
- Bolt allows only one read-write transaction at a time but allows as many read-only transactions as you want at a time
- Each transaction has a consistent view of the data as it existed when the transaction started
- You can only retrieve buckets, retrieve values, and copy the database within a read-only transaction
- Concurrent Batch calls are opportunistically combined into larger transactions
- Bolt stores its keys in byte-sorted order within a bucket. This makes sequential iteration over these keys extremely fast
- The cursor allows you to move to a specific point in the list of keys and move forward or backward through the keys one at a time