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

support rocksdb column family #59

Open
yihuang opened this issue Nov 18, 2022 · 4 comments
Open

support rocksdb column family #59

yihuang opened this issue Nov 18, 2022 · 4 comments

Comments

@yihuang
Copy link
Contributor

yihuang commented Nov 18, 2022

column family fits well with different iavl stores, at least it's easier to check the db states of different stores, potentially could tune db options separately.

But it seems not easy to do that transparently, without changing a few apis.

@tac0turtle
Copy link
Member

I'm generally happy to accommodate changes in this repo for our use case. Would you want to submit a proposal of the api change

@yihuang
Copy link
Contributor Author

yihuang commented Nov 18, 2022

Maybe the simplest way is just adding a new method to DB interface:

OpenSubDB(name string) DB

If can return nil if don't support similar concept.

And change here in cosmos-sdk into:

db := rs.db.OpenSubDB(params.key.Name())
if db == nil {
    db = NewPrefixDB(...)
}

Or the unsupported db backends can just return a PrefixDB.

@yihuang
Copy link
Contributor Author

yihuang commented Nov 18, 2022

This change won't take advantage of atomic commit cross multiple column families, but that's another topic.

@yihuang
Copy link
Contributor Author

yihuang commented Nov 18, 2022

It'll need an option to switch explicitly, otherwise existing rocksdb nodes will suddenly fail.

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

No branches or pull requests

2 participants