Skip to content

Understand and simplify CometBFT database backend #48

Closed as duplicate

Description

@lasarojc

Supersedes tendermint/tendermint#6032, breaking that issue down into more concrete, clearly separated deliverables/sub-tasks.

It's ultimately expensive and painful for the team to have to cater to many different use cases that require different underlying storage engines, and we would rather converge on a single database that meets our core requirements well. We do, however, want to simultaneously provide ways for integrators to access and transform core data into whatever storage system suits their use case.

Problems

  1. Through cometbft-db, CometBFT currently supports multiple database backends. As such:
    1. CometBFT does not make extensive use of database-specific optimizations.
    2. Storage behavior is not consistent across different databases, potentially resulting in more troubleshooting and bug fixing work for the team (e.g. genesis file may go over the recommended maximum value size tendermint/tendermint#8416, Remove genesis persistence in state db #1017 ).
  2. While we could just decide to only support GoLevelDB (as per use only goleveldb tendermint/tendermint#9741), one of the most commonly used underlying databases for CometBFT, it seems to struggle with pruning (see Add in-process compaction support to LevelDB tendermint/tendermint#9743, Investigate why Tendermint disk storage keeps growing over time informalsystems/interchain#1). It's also not clear, given our typical storage workloads for the most common use cases, whether the underlying data structure that LevelDB provides is even suitable for CometBFT. Current problems experienced by operators seem to suggest otherwise.
  3. We currently do not have a very clear set of requirements for an underlying database for CometBFT.

RFC-001 provides some more detail around the problem space.

Work Breakdown

In order to achieve our overall goal of storage simplification, we need to complete the following work.

Original issue: tendermint/tendermint#9749

Activity

  1. added
    breaking
    tracking
    on Dec 23, 2022
  2. changed the title [-]Simplify Tendermint database engine support[/-] [+]Simplify CometBFT database engine support[/+] on Mar 27, 2023
  3. moved this from Todo to In Progress in CometBFT 2023on Mar 29, 2023
  4. added
    P:storage-optimization
    on Jun 20, 2023
  5. changed the title [-]Simplify CometBFT database engine support[/-] [+]Understand and simplify CometBFT database backend[/+] on Jun 27, 2023
  6. modified the milestone: 2023-Q3 on Jun 27, 2023
  7. faddat commented on Jan 9, 2024

    @faddat
    Contributor

    cometbft/cometbft-db#112 (comment)

    So that's my reasoning. I'm happy to try to make goleveldb faster, too. You will need a beefy machine for the benchmarks.

    Here is a branch with benchmarks:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P:storage-optimizationbreakingstoragetracking

    Type

    No type

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions