BoltDB is an open source database built purely on Go. It is designed to store data on a mapped memory file. It is a Go package that doesn‘t need to be installed before the developer starts coding. This significantly saves the installation time and setting of the database and solving configuration problems, users and accesses. This problems can‘t be found in Bolt, as it doesn‘t have users and settings, only a filename.

Bolt is not a relational database. It‘s a storage based on the key-value principle. The storage space in Bolt is divided into buckets. A bucket is a file of key-value pairs similar to the Go map. The bucket name, keys and values are of the byte type. A bucket contain other buckets.

All read and write operations in the Bolt database must be handled using transactions. You can have any number of reading in operations that only read, but only one operation that writes at a specific time. Reading operations will retain a consistent view even at the time of writing.

The advantages of using Bolt

  • Quick start of operation. There is no need to install and configure like conventional databases. There is no need to deal with users and accesses, only one filename is sufficient.
  • Quicker saving of smaller files. Unlike Badger, Bolt has quicker saving, e. g. the 128B file.
  • Clean and well-documentated API.
  • Unlimited number of data-reading operations. At the same time, while writing, the database retains a consistent view for data-reading operations.
  • The ACID transactions support

The disadvantages of using Bolt

  • Slow data-loading. Badger is faster in loading data than Bolt.
  • Reading latency. Bolt has a worse latency for reading data files than Badger, for example.
  • Limit to only one operation writing to the database in a specific time.