{"id":27203572,"url":"https://github.com/cometbft/cometbft-db","last_synced_at":"2025-05-16T10:07:48.241Z","repository":{"id":65662070,"uuid":"581341190","full_name":"cometbft/cometbft-db","owner":"cometbft","description":"Database wrapper for CometBFT","archived":false,"fork":false,"pushed_at":"2025-05-13T19:24:52.000Z","size":870,"stargazers_count":31,"open_issues_count":2,"forks_count":68,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-05-13T20:45:22.559Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cometbft.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-12-22T23:08:53.000Z","updated_at":"2025-05-13T19:24:54.000Z","dependencies_parsed_at":"2023-11-16T11:41:42.493Z","dependency_job_id":"b5268546-b03a-4016-b8fa-ca12a9703cb8","html_url":"https://github.com/cometbft/cometbft-db","commit_stats":{"total_commits":288,"total_committers":22,"mean_commits":"13.090909090909092","dds":0.6145833333333333,"last_synced_commit":"08c35fbb12eb3f16c5a67c4b2eac6c0ef6a782a6"},"previous_names":["cometbft/tm-db"],"tags_count":38,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cometbft%2Fcometbft-db","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cometbft%2Fcometbft-db/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cometbft%2Fcometbft-db/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cometbft%2Fcometbft-db/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cometbft","download_url":"https://codeload.github.com/cometbft/cometbft-db/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254509476,"owners_count":22082891,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-04-09T22:40:22.490Z","updated_at":"2025-05-16T10:07:43.233Z","avatar_url":"https://github.com/cometbft.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CometBFT DB\n\n[![version](https://img.shields.io/github/tag/cometbft/cometbft-db.svg)](https://github.com/cometbft/cometbft-db/releases/latest)\n[![license](https://img.shields.io/github/license/cometbft/cometbft-db.svg)](https://github.com/cometbft/cometbft-db/blob/main/LICENSE)\n[![API Reference](https://camo.githubusercontent.com/915b7be44ada53c290eb157634330494ebe3e30a/68747470733a2f2f676f646f632e6f72672f6769746875622e636f6d2f676f6c616e672f6764646f3f7374617475732e737667)](https://pkg.go.dev/github.com/cometbft/cometbft-db)\n[![codecov](https://codecov.io/gh/cometbft/cometbft-db/branch/main/graph/badge.svg)](https://codecov.io/gh/cometbft/cometbft-db)\n![Lint](https://github.com/cometbft/cometbft-db/workflows/Lint/badge.svg?branch=main)\n![Test](https://github.com/cometbft/cometbft-db/workflows/Test/badge.svg?branch=main)\n\nA fork of [tm-db].\n\nCommon database interface for various database backends. Primarily meant for\napplications built on [CometBFT], such as the [Cosmos SDK].\n\n**NB:** As per [cometbft/cometbft\\#48], the CometBFT team plans on eventually\ntotally deprecating and removing this library from CometBFT. As such, we do not\nrecommend depending on this library for new projects.\n\n## Minimum Go Version\n\nGo 1.23+\n\n## Supported Database Backends\n\n- **[GoLevelDB](https://github.com/syndtr/goleveldb) [stable]**: A pure Go\n  implementation of [LevelDB](https://github.com/google/leveldb) (see below).\n  Currently the default on-disk database used in the Cosmos SDK.\n\n- **MemDB [stable]:** An in-memory database using [Google's B-tree\n  package](https://github.com/google/btree). Has very high performance both for\n  reads, writes, and range scans, but is not durable and will lose all data on\n  process exit. Does not support transactions. Suitable for e.g. caches, working\n  sets, and tests. Used for [IAVL](https://github.com/tendermint/iavl) working\n  sets when the pruning strategy allows it.\n\n- **[LevelDB](https://github.com/google/leveldb) [DEPRECATED]:** A [Go\n  wrapper](https://github.com/jmhodges/levigo) around\n  [LevelDB](https://github.com/google/leveldb). Uses LSM-trees for on-disk\n  storage, which have good performance for write-heavy workloads, particularly\n  on spinning disks, but requires periodic compaction to maintain decent read\n  performance and reclaim disk space. Does not support transactions.\n\n- **[BoltDB](https://github.com/etcd-io/bbolt) [DEPRECATED]:** A\n  [fork](https://github.com/etcd-io/bbolt) of\n  [BoltDB](https://github.com/boltdb/bolt). Uses B+trees for on-disk storage,\n  which have good performance for read-heavy workloads and range scans. Supports\n  serializable ACID transactions.\n\n- **[RocksDB](https://github.com/linxGnu/grocksdb) [experimental]:** A [Go\n  wrapper](https://github.com/linxGnu/grocksdb) around\n  [RocksDB](https://rocksdb.org). Similarly to LevelDB (above) it uses LSM-trees\n  for on-disk storage, but is optimized for fast storage media such as SSDs and\n  memory. Supports atomic transactions, but not full ACID transactions.\n\n- **[BadgerDB](https://github.com/dgraph-io/badger) [experimental]:** A\n  key-value database written as a pure-Go alternative to e.g. LevelDB and\n  RocksDB, with LSM-tree storage. Makes use of multiple goroutines for\n  performance, and includes advanced features such as serializable ACID\n  transactions, write batches, compression, and more.\n\n- **[PebbleDB](https://github.com/cockroachdb/pebble) [experimental]:** Pebble\n  is a LevelDB/RocksDB inspired key-value store focused on performance and\n  internal usage by CockroachDB. Pebble inherits the RocksDB file formats and a\n  few extensions such as range deletion tombstones, table-level bloom filters,\n  and updates to the MANIFEST format.\n\n  CAVEAT: there are reports of broken upgrade process when using [Cosmos\n  SDK](https://github.com/cosmos/cosmos-sdk).\n\n## Meta-databases\n\n- **PrefixDB [stable]:** A database which wraps another database and uses a\n  static prefix for all keys. This allows multiple logical databases to be\n  stored in a common underlying databases by using different namespaces. Used by\n  the Cosmos SDK to give different modules their own namespaced database in a\n  single application database.\n\n## Tests\n\nTo test common databases, run `make test`. If all databases are available on the\nlocal machine, use `make test-all` to test them all.\n\nTo test all databases within a Docker container, run:\n\n```bash\nmake docker-test-image\nmake docker-test\n```\n\n[tm-db]: https://github.com/tendermint/tm-db\n[CometBFT]: https://github.com/cometbft/cometbft-db\n[Cosmos SDK]: https://github.com/cosmos/cosmos-sdk\n[cometbft/cometbft\\#48]: https://github.com/cometbft/cometbft/issues/48\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcometbft%2Fcometbft-db","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcometbft%2Fcometbft-db","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcometbft%2Fcometbft-db/lists"}