BoltDB

BoltDB is an embedded key/value database written in Go. It supports fully serializable transactions, ACID semantics, and lock-free MVCC with multiple readers and a single writer. BoltDB uses a single-level, zero-copy, B+tree data storage, which allows fast read access and does not require recovery in the event of a system crash.

History

In 2011, Howard Chu introduced MDB, a memory-mapped database backend for OpenLDAP, later renamed to [LMDB] (https://symas.com/lmdb/technical/)(Lightning Memory-Mapped Database). In 2013, BoltDB was initially started by Ben Johnson as a port of LMDB to Go, but then the two projects diverged as the author of Bolt decided to focus on simplicity and providing the easy-to-use Go API. The goal of BoltDB became to provide a simple, fast, and reliable database for projects that don't require a full database server such as Postgres or MySQL. With BoltDB being stable, its API fixed, and its file format fixed, the author considered the project a success. Leaving it in such a state, the project was abandoned by its author in 2017.

Query Interface

Custom API

Views

Virtual Views

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. BoltDB recommends three types of transactions: read-write transactions with `DB.Update`, read-only transactions with `DB.View` and batch read-write transactions with `DB.Batch`. Along with the three recommended transactions, BoltDB also allows manual transaction management with `DB.Begin`.

Concurrency Control

Multi-version Concurrency Control (MVCC)

BoltDB allows only one read-write transaction at a time.

Logging

Not Supported

Bolt saves data into a single memory-mapped file on disk. It doesn’t have a separate journal or write-ahead log.

Storage Model

Custom

BoltDB uses key/value storage, which does not involve rows or columns.

Isolation Levels

Serializable

Indexes

B+Tree

Checkpoints

Not Supported

Foreign Keys

Not Supported

Data Model

Key/Value

Bolt is a key-value store that provides an ordered map, which allows easy access and lookup.

System Architecture

Embedded

Query Compilation

Not Supported

Storage Organization

Copy-on-Write / Shadow Paging

BoltDB Logo
Website

https://github.com/boltdb/bolt

Source Code

https://github.com/boltdb/bolt

Tech Docs

https://godoc.org/github.com/boltdb/bolt

Developer

Ben Johnson

Country of Origin

US

Start Year

2013

End Year

2017

Project Type

Open Source

Written in

Go

Supported languages

Go

Inspired By

LMDB

Operating Systems

Android, BSD, iOS, Linux, OS X, Solaris, Windows

Licenses

MIT