Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PebbleDB #230

Closed
wants to merge 27 commits into from
Closed

PebbleDB #230

wants to merge 27 commits into from

Conversation

faddat
Copy link
Contributor

@faddat faddat commented Apr 12, 2022

I spoke with the Terra team, and they mentioned that because their CosmWasm usage is high, there were issues with cgo/FFI (Rocks will hit this, as will CosmWasm, and this resulted in high overhead) when using RockDB, making it a less than ideal solution for their needs. Since CosmWasm is being adopted pretty widely in Cosmos, we're experimenting with PebbleDB, which outperforms RocksDB in synthetic benchmark tests.

Currently, the goal of these changes is to be able to test them and see if they increase RPC capacity on relayers, so that the IBC relay network can be more reliable.

@codecov
Copy link

codecov bot commented Apr 12, 2022

Codecov Report

Merging #230 (83d85ef) into master (e09e4d6) will decrease coverage by 0.05%.
The diff coverage is 90.00%.

❗ Current head 83d85ef differs from pull request most recent head 2dd592c. Consider uploading reports for the commit 2dd592c to get more accurate results

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #230      +/-   ##
==========================================
- Coverage   68.54%   68.48%   -0.06%     
==========================================
  Files          27       27              
  Lines        2130     2126       -4     
==========================================
- Hits         1460     1456       -4     
  Misses        595      595              
  Partials       75       75              
Impacted Files Coverage Δ
badger_db.go 87.77% <0.00%> (ø)
boltdb.go 57.25% <ø> (ø)
boltdb_batch.go 82.69% <ø> (ø)
boltdb_iterator.go 92.10% <ø> (ø)
cleveldb.go 70.99% <ø> (ø)
cleveldb_batch.go 82.35% <ø> (ø)
db.go 35.00% <ø> (ø)
prefixdb_iterator.go 81.01% <ø> (-0.24%) ⬇️
rocksdb.go 72.26% <ø> (ø)
rocksdb_batch.go 84.31% <ø> (ø)
... and 3 more
Impacted Files Coverage Δ
badger_db.go 87.77% <0.00%> (ø)
boltdb.go 57.25% <ø> (ø)
boltdb_batch.go 82.69% <ø> (ø)
boltdb_iterator.go 92.10% <ø> (ø)
cleveldb.go 70.99% <ø> (ø)
cleveldb_batch.go 82.35% <ø> (ø)
db.go 35.00% <ø> (ø)
prefixdb_iterator.go 81.01% <ø> (-0.24%) ⬇️
rocksdb.go 72.26% <ø> (ø)
rocksdb_batch.go 84.31% <ø> (ø)
... and 3 more

@faddat faddat marked this pull request as ready for review April 12, 2022 12:01
@faddat faddat changed the title wip: PebbleDB PebbleDB Apr 12, 2022
@faddat
Copy link
Contributor Author

faddat commented Apr 12, 2022

Remaining things to do here include adding pebbledb to the iavl benchmarks

@faddat
Copy link
Contributor Author

faddat commented Apr 13, 2022

this contains a bug affecting goleveldb that we added while messing about. I'm going to close it and submit a pr that only touches pebble stuff.

@faddat faddat closed this Apr 13, 2022
github-merge-queue bot pushed a commit to cometbft/cometbft that referenced this pull request Jan 29, 2024
This PR integrates pebbledb, a key-value store by Cockroachdb based on
Cockroach Labs findings about cgo:

* https://www.cockroachlabs.com/blog/the-cost-and-complexity-of-cgo/


Unlike any other kv store that cometbft currently supports:

* pebble is actively maintained unlike:
  * goleveldb
  * boltdb
  * badgerdb 
* pebble does not require the use of CGO like:
  * cleveldb
  * rocksdb

In benchmarks:

* pebble performs better than goleveldb, cleveldb and rocksdb
* pebble performs consistently

At Notional Ventures, Pte, we've used and submitted pebble for two years
for:

* archive nodes that would be crushed if they used goleveldb
* high performance RPC infrastructure

Here are the hitstorical pull requests to merge pebble:

* tendermint/tm-db#230
* tendermint/tm-db#231
* tendermint/tm-db#281
* tendermint/tm-db#282
* tendermint/tm-db#283
* tendermint/tm-db#284
* tendermint/tm-db#304
* tendermint/tm-db#321

Pebble snapshots for cosmos blockchains are available here:

* https://snapshot.notional.ventures/

---

#### PR checklist

- [ ] Tests written/updated
- [x] Changelog entry added in `.changelog` (we use
[unclog](https://github.com/informalsystems/unclog) to manage our
changelog)
- [x] Updated relevant documentation (`docs/` or `spec/`) and code
comments
- [x] Title follows the [Conventional
Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec

---------

Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com>
mergify bot pushed a commit to cometbft/cometbft that referenced this pull request Jan 29, 2024
This PR integrates pebbledb, a key-value store by Cockroachdb based on
Cockroach Labs findings about cgo:

* https://www.cockroachlabs.com/blog/the-cost-and-complexity-of-cgo/

Unlike any other kv store that cometbft currently supports:

* pebble is actively maintained unlike:
  * goleveldb
  * boltdb
  * badgerdb
* pebble does not require the use of CGO like:
  * cleveldb
  * rocksdb

In benchmarks:

* pebble performs better than goleveldb, cleveldb and rocksdb
* pebble performs consistently

At Notional Ventures, Pte, we've used and submitted pebble for two years
for:

* archive nodes that would be crushed if they used goleveldb
* high performance RPC infrastructure

Here are the hitstorical pull requests to merge pebble:

* tendermint/tm-db#230
* tendermint/tm-db#231
* tendermint/tm-db#281
* tendermint/tm-db#282
* tendermint/tm-db#283
* tendermint/tm-db#284
* tendermint/tm-db#304
* tendermint/tm-db#321

Pebble snapshots for cosmos blockchains are available here:

* https://snapshot.notional.ventures/

---

#### PR checklist

- [ ] Tests written/updated
- [x] Changelog entry added in `.changelog` (we use
[unclog](https://github.com/informalsystems/unclog) to manage our
changelog)
- [x] Updated relevant documentation (`docs/` or `spec/`) and code
comments
- [x] Title follows the [Conventional
Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec

---------

Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com>
(cherry picked from commit 82fa3c0)
melekes added a commit to cometbft/cometbft that referenced this pull request Jan 29, 2024
This PR integrates pebbledb, a key-value store by Cockroachdb based on
Cockroach Labs findings about cgo:

* https://www.cockroachlabs.com/blog/the-cost-and-complexity-of-cgo/


Unlike any other kv store that cometbft currently supports:

* pebble is actively maintained unlike:
  * goleveldb
  * boltdb
  * badgerdb 
* pebble does not require the use of CGO like:
  * cleveldb
  * rocksdb

In benchmarks:

* pebble performs better than goleveldb, cleveldb and rocksdb
* pebble performs consistently

At Notional Ventures, Pte, we've used and submitted pebble for two years
for:

* archive nodes that would be crushed if they used goleveldb
* high performance RPC infrastructure

Here are the hitstorical pull requests to merge pebble:

* tendermint/tm-db#230
* tendermint/tm-db#231
* tendermint/tm-db#281
* tendermint/tm-db#282
* tendermint/tm-db#283
* tendermint/tm-db#284
* tendermint/tm-db#304
* tendermint/tm-db#321

Pebble snapshots for cosmos blockchains are available here:

* https://snapshot.notional.ventures/

---

#### PR checklist

- [ ] Tests written/updated
- [x] Changelog entry added in `.changelog` (we use
[unclog](https://github.com/informalsystems/unclog) to manage our
changelog)
- [x] Updated relevant documentation (`docs/` or `spec/`) and code
comments
- [x] Title follows the [Conventional
Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec

---------

Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants