.github
Remove @creachadair from the CODEOWNERS file. (#285)
docs
docs: add information on how to release tm-db (#180)
remotedb
Gofumpt second pass (#277)
tools
testing: tools/Dockerfile: Upgrade RocksDB to 6.24.2 (#197)
.gitignore
Update .gitignore (#247)
.gitpod.yml
fix: remove mutex in prefixdb (#239)
.golangci.yml
Gofumpt second pass (#277)
.mergify.yml
Update mergify configuration. (#198)
backend_test.go
fix: remove mutex in prefixdb (#239)
badger_db.go
fix: remove mutex in prefixdb (#239)
boltdb_batch.go
fix: remove mutex in prefixdb (#239)
boltdb_iterator.go
fix: remove mutex in prefixdb (#239)
boltdb_test.go
fix: remove mutex in prefixdb (#239)
boltdb.go
fix: remove mutex in prefixdb (#239)
CHANGELOG.md
fix: remove mutex in prefixdb (#239)
cleveldb_batch.go
fix: remove mutex in prefixdb (#239)
cleveldb_iterator.go
fix: remove mutex in prefixdb (#239)
cleveldb_test.go
fix: remove mutex in prefixdb (#239)
cleveldb.go
fix cleveldb Stat() (#273)
codecov.yml
add codecov (#102)
common_test.go
cosmos/gorocksdb in the imports (#214)
CONTRIBUTING.md
update changelog for v0.6.4 (#150)
db_test.go
Prepare a new compatibility release v0.6.6. (#203)
db.go
cosmos/gorocksdb in the imports (#214)
go.mod
build(deps): bump google.golang.org/grpc from 1.48.0 to 1.50.1 (#300)
go.sum
build(deps): bump google.golang.org/grpc from 1.48.0 to 1.50.1 (#300)
goleveldb_batch.go
Prepare a new compatibility release v0.6.6. (#203)
goleveldb_iterator.go
fix: remove mutex in prefixdb (#239)
goleveldb_test.go
Prepare a new compatibility release v0.6.6. (#203)
goleveldb.go
goleveldb: ForceCompact (#216)
LICENSE
license: remove non-standard prefix (#108)
makefile
Prepare a new compatibility release v0.6.6. (#203)
memdb_batch.go
Prepare a new compatibility release v0.6.6. (#203)
memdb_iterator.go
implement btree.item on item itelf, not only its pointer. (#254)
memdb_test.go
Prepare a new compatibility release v0.6.6. (#203)
memdb.go
implement btree.item on item itelf, not only its pointer. (#254)
prefixdb_batch.go
Prepare a new compatibility release v0.6.6. (#203)
prefixdb_iterator.go
fix: remove mutex in prefixdb (#239)
prefixdb_test.go
fix: remove mutex in prefixdb (#239)
prefixdb.go
fix: remove mutex in prefixdb (#239)
README.md
cosmos/gorocksdb in the imports (#214)
rocksdb_batch.go
fix: remove mutex in prefixdb (#239)
rocksdb_iterator.go
fix: remove mutex in prefixdb (#239)
rocksdb_test.go
fix: remove mutex in prefixdb (#239)
rocksdb.go
no pedantic (#279)
test_helpers.go
Prepare a new compatibility release v0.6.6. (#203)
types.go
Prepare a new compatibility release v0.6.6. (#203)
util_test.go
cosmos/gorocksdb in the imports (#214)
util.go
reject nil/empty keys and nil values (#99)

Tendermint DB

Common database interface for various database backends. Primarily meant for applications built on Tendermint, such as the Cosmos SDK, but can be used independently of these as well.

Minimum Go Version

Go 1.13+

Supported Database Backends

  • GoLevelDB [stable]: A pure Go implementation of LevelDB (see below). Currently the default on-disk database used in the Cosmos SDK.

  • MemDB [stable]: An in-memory database using Google's B-tree package. Has very high performance both for reads, writes, and range scans, but is not durable and will lose all data on process exit. Does not support transactions. Suitable for e.g. caches, working sets, and tests. Used for IAVL working sets when the pruning strategy allows it.

  • LevelDB [experimental]: A Go wrapper around LevelDB. Uses LSM-trees for on-disk storage, which have good performance for write-heavy workloads, particularly on spinning disks, but requires periodic compaction to maintain decent read performance and reclaim disk space. Does not support transactions.

  • BoltDB [experimental]: A fork of BoltDB. Uses B+trees for on-disk storage, which have good performance for read-heavy workloads and range scans. Supports serializable ACID transactions.

  • RocksDB [experimental]: A Go wrapper around RocksDB. Similarly to LevelDB (above) it uses LSM-trees for on-disk storage, but is optimized for fast storage media such as SSDs and memory. Supports atomic transactions, but not full ACID transactions.

  • BadgerDB [experimental]: A key-value database written as a pure-Go alternative to e.g. LevelDB and RocksDB, with LSM-tree storage. Makes use of multiple goroutines for performance, and includes advanced features such as serializable ACID transactions, write batches, compression, and more.

Meta-databases

  • PrefixDB [stable]: A database which wraps another database and uses a static prefix for all keys. This allows multiple logical databases to be stored in a common underlying databases by using different namespaces. Used by the Cosmos SDK to give different modules their own namespaced database in a single application database.

  • RemoteDB [experimental]: A database that connects to distributed Tendermint db instances via gRPC. This can help with detaching difficult deployments such as LevelDB, and can also ease dependency management for Tendermint developers.

Tests

To test common databases, run make test. If all databases are available on the local machine, use make test-all to test them all.