Skip to content

introduce DB options when creating new backend DB #50

Closed
@JayT106

Description

@JayT106

When testing Cronos functionalities, we think the changes in tendermint/tm-db#218 made the DB consume too much RAM. Instead of hardcoding the max open file number, we prefer it to be adjustable based on the instance's resources.
Therefore,

We may introduce DBOptions into dbCreator, i.e.

type (
	dbCreator func(name string, dir string, opts DBOptions) (DB, error)

	DBOptions interface {
		Get(string) interface{}
	}
)

and introduce a new method and then update the original NewDB implementation

func NewDBwithOptions(name string, backend BackendType, dir string, opts DBOptions) (DB, error) {

func NewDB(name string, backend BackendType, dir string) (DB, error) {
	return NewDBwithOptions(name, backend, dir, nil)
}

Therefore, it will be easier to make DB adjustments to the Cosmos SDK when the DB supports certain options.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions