An embedded key/value database for Go.
 
 
Go to file
Ben Johnson 754966bea0 Optimize Tx.Check().
This commit removes several memory allocations occurring on every page and also caches the freelist map used when iterating over the pages. This results in significantly better performance.
2014-05-28 12:50:48 -06:00
cmd/bolt Optimize Tx.Check(). 2014-05-28 12:50:48 -06:00
.gitignore add bin to gitignore 2014-04-09 11:50:53 +00:00
LICENSE Initial commit 2013-12-20 10:26:14 -08:00
Makefile Remove allocations from read-only buckets. 2014-05-23 10:40:09 -06:00
README.md README 2014-05-19 16:16:36 -06:00
bolt.go Avoid trashing page cache on Tx.Copy(). 2014-05-23 11:40:05 -06:00
bolt_linux.go Avoid trashing page cache on Tx.Copy(). 2014-05-23 11:40:05 -06:00
bucket.go Remove allocations from read-only buckets. 2014-05-23 10:40:09 -06:00
bucket_test.go Fix freelist allocation direction. 2014-05-19 12:08:33 -06:00
cursor.go Fix freelist allocation direction. 2014-05-19 12:08:33 -06:00
cursor_test.go Merge pull request #134 from Shopify/c_cursor 2014-04-21 07:24:48 -06:00
db.go Add streaming check. 2014-05-28 10:31:22 -06:00
db_test.go Add streaming check. 2014-05-28 10:31:22 -06:00
doc.go Consolidate Tx and RWTx. 2014-03-08 20:40:48 -07:00
freelist.go Fix freelist allocate(). 2014-05-19 14:11:32 -06:00
freelist_test.go Fix freelist allocate(). 2014-05-19 14:11:32 -06:00
node.go Add circular dependency integrity check. 2014-05-28 08:02:55 -06:00
node_test.go Change verbiage, fix node test. 2014-05-15 14:21:17 -06:00
page.go Fix freelist allocate(). 2014-05-19 14:11:32 -06:00
page_test.go Add nested buckets. 2014-04-11 12:36:54 -06:00
quick_test.go Minor refactor. 2014-02-28 15:13:07 -07:00
simulation_test.go Fix deletion reclamation. 2014-05-09 09:26:34 -06:00
tx.go Optimize Tx.Check(). 2014-05-28 12:50:48 -06:00
tx_test.go Add streaming check. 2014-05-28 10:31:22 -06:00

README.md

Bolt Build Status Coverage Status GoDoc Project status

Overview

Bolt is a pure Go key/value store inspired by Howard Chu and the 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. It is also meant to be educational. Most of us use tools without understanding how the underlying data really works.

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 center around getting values and setting values. That's it. If you want to see additional functionality added then we encourage you submit a Github issue and we can discuss developing it as a separate fork.

Simple is the new beautiful.

Tobias Lütke

Project Status

Bolt is functionally complete and has nearly full unit test coverage. The library test suite also includes randomized black box testing to ensure database consistency and thread safety. Bolt is currently in use in a few projects, however, it is still at a beta stage so please use with caution and report any bugs found.

Comparing Bolt vs LMDB

Bolt is inspired by LMDB so there are many similarities between the two:

  1. Both use a B+Tree data structure.

  2. ACID semantics with fully serializable transactions.

  3. Lock-free MVCC support using a single writer and multiple readers.

There are also several differences between Bolt and LMDB:

  1. LMDB supports more additional features such as multi-value keys, fixed length keys, multi-key insert, and direct writes. Bolt only supports basic Get(), Put(), and Delete() operations and bidirectional cursors.

  2. LMDB databases can be shared between processes. Bolt only allows a single process access.

  3. LMDB is written in C and extremely fast. Bolt is fast but not as fast as LMDB.

  4. LMDB is a more mature library and is used heavily in projects such as OpenLDAP.

So why use Bolt? The goal of Bolt is provide a simple, fast data store that is easily integrated into Go projects. The library does not require CGO so it is compatible with go get and you can easily build static binaries with it. We are not accepting additional functionality into the library so the API and file format are stable. Bolt also has near 100% unit test coverage and also includes heavy black box testing using the testing/quick package.

Other Projects Using Bolt

Below is a list of public, open source projects that use Bolt:

  • Bazil - A file system that lets your data reside where it is most convenient for it to reside.
  • DVID - Added Bolt as optional storage engine and testing it against Basho-tuned leveldb.
  • Skybox Analytics - A standalone funnel analysis tool for web analytics.
  • Scuttlebutt - Uses Bolt to store and process all Twitter mentions of GitHub projects.
  • Wiki - A tiny wiki using Goji, BoltDB and Blackfriday.
  • ChainStore - Simple key-value interface to a variety of storage engines organized as a chain of operations.
  • MetricBase - Single-binary version of Graphite.
  • Gitchain - Decentralized, peer-to-peer Git repositories aka "Git meets Bitcoin".
  • SkyDB - Behavioral analytics database.

If you are using Bolt in a project please send a pull request to add it to the list.