Skip to content

Commit

Permalink
Deprecate boltdb and cleveldb (#153)
Browse files Browse the repository at this point in the history
* deprecate boltdb and cleveldb

Closes #143

* add changelog
  • Loading branch information
melekes committed Apr 10, 2024
1 parent fbeb1f5 commit 8c87373
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Deprecate boltdb and cleveldb. If you're using either of those, please reach
out ([\#153](https://github.com/cometbft/cometbft-db/pull/153))
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ Go 1.22+
sets, and tests. Used for [IAVL](https://github.com/tendermint/iavl) working
sets when the pruning strategy allows it.

- **[LevelDB](https://github.com/google/leveldb) [experimental]:** A [Go
- **[LevelDB](https://github.com/google/leveldb) [DEPRECATED]:** A [Go
wrapper](https://github.com/jmhodges/levigo) around
[LevelDB](https://github.com/google/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](https://github.com/etcd-io/bbolt) [experimental]:** A
- **[BoltDB](https://github.com/etcd-io/bbolt) [DEPRECATED]:** A
[fork](https://github.com/etcd-io/bbolt) of
[BoltDB](https://github.com/boltdb/bolt). Uses B+trees for on-disk storage,
which have good performance for read-heavy workloads and range scans. Supports
Expand Down
2 changes: 2 additions & 0 deletions boltdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ type BoltDB struct {
var _ DB = (*BoltDB)(nil)

// NewBoltDB returns a BoltDB with default options.
//
// Deprecated: boltdb is deprecated and will be removed in the future.
func NewBoltDB(name, dir string) (DB, error) {
return NewBoltDBWithOpts(name, dir, bbolt.DefaultOptions)
}
Expand Down
2 changes: 2 additions & 0 deletions cleveldb.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ type CLevelDB struct {
var _ DB = (*CLevelDB)(nil)

// NewCLevelDB creates a new CLevelDB.
//
// Deprecated: cleveldb is deprecated and will be removed in the future.
func NewCLevelDB(name string, dir string) (*CLevelDB, error) {
dbPath := filepath.Join(dir, name+".db")

Expand Down

0 comments on commit 8c87373

Please sign in to comment.