An embedded key/value database for Go.
 
 
Go to file
Ben Johnson 41aa602f27 Document key/value lifecycle.
This commit adds a caveat to the godoc that explains how key and value
byte slices will only be valid for the life of the transaction.
2014-06-16 09:42:59 -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 errcheck. 2014-06-12 09:32:29 -06:00
README.md Add ipxed to README. 2014-06-02 09:17:37 -06:00
bolt_386.go Add Windows support. 2014-06-12 09:23:30 -06:00
bolt_amd64.go Add Windows support. 2014-06-12 09:23:30 -06:00
bolt_darwin.go Add Windows support. 2014-06-12 09:23:30 -06:00
bolt_linux.go Add Windows support. 2014-06-12 09:23:30 -06:00
bolt_windows.go Add Windows support. 2014-06-12 09:23:30 -06:00
bucket.go Fix merge-split spill issues. 2014-06-03 13:40:24 -06:00
bucket_test.go Fix freelist rollback. 2014-06-13 15:50:47 -06:00
cursor.go add Cursor.Delete() 2014-06-11 21:46:19 +00:00
cursor_test.go add Cursor.Delete() 2014-06-11 21:46:19 +00:00
db.go Fix deadlock on remmap. 2014-06-13 12:07:37 -06:00
db_test.go Fix merge-split spill issues. 2014-06-03 13:40:24 -06:00
doc.go Document key/value lifecycle. 2014-06-16 09:42:59 -06:00
freelist.go Fix freelist rollback. 2014-06-13 15:50:47 -06:00
freelist_test.go Fix freelist allocate(). 2014-05-19 14:11:32 -06:00
node.go Fix double free in merge-left rebalance. 2014-06-06 17:14:17 -06:00
node_test.go Change verbiage, fix node test. 2014-05-15 14:21:17 -06:00
page.go Increase max nodes per page. 2014-06-10 09:38:40 -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 Fix freelist rollback. 2014-06-13 15:50:47 -06:00
tx_test.go Add freelist assertion on every free(). 2014-05-29 08:02:15 -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.
  • event-shuttle - A Unix system service to collect and reliably deliver messages to Kafka.
  • ipxed - Web interface and api for ipxed.

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