Skip to content
This repository has been archived by the owner on Dec 1, 2024. It is now read-only.

Can we reuse binding.cc code in e.g. rocksdb? #570

Closed
ralphtheninja opened this issue Dec 21, 2018 · 4 comments
Closed

Can we reuse binding.cc code in e.g. rocksdb? #570

ralphtheninja opened this issue Dec 21, 2018 · 4 comments
Labels
discussion Discussion

Comments

@ralphtheninja
Copy link
Member

ralphtheninja commented Dec 21, 2018

It would be nice if we could re-use the glue code for e.g. rocksdb so it could be based on napi as well, leveldownmiddle? 😁

At least spend some time thinking about this. In theory it should be possible to extract the glue code into a separate module, given that the underlying store exposes the same api.

@vweevers
Copy link
Member

By glue code, do you mean the JS, binding.cc or both?

Would it still be possible to add RocksDB-specific options (Level/rocksdb#13)?

@vweevers vweevers added the discussion Discussion label Dec 22, 2018
@ralphtheninja
Copy link
Member Author

ralphtheninja commented Dec 22, 2018

By glue code, do you mean the JS, binding.cc or both?

Aah sorry this was a bit unclear. I primarily meant the binding.cc code, but reusing js code would also be of advantage.

Would it still be possible to add RocksDB-specific options (Level/rocksdb#13)?

Good question. We might need to do some tweaks to the binding code.

@ralphtheninja ralphtheninja changed the title Do something smart with glue code Do something smart with the binding.cc code Dec 22, 2018
@ralphtheninja ralphtheninja changed the title Do something smart with the binding.cc code Can we reuse binding.cc code in e.g. rocksdb? Dec 22, 2018
@vweevers
Copy link
Member

I don't know how to achieve this, taking the differences (Level/rocksdb#100 (comment)) into account.

What I can do, is copy binding.cc verbatim from leveldown to rocksdb and make sure this ends up in its own commit (A) in master. Then record the necessary RocksDB changes in a second commit (B). Future leveldown changes can be cherry-picked onto master, but should we get into big merge conflicts, we also have the option of reapplying B - which will be relatively small - onto a new binding.cc.

Namespace aliases (namespace leveldb = rocksdb) could make B even smaller.

@vweevers
Copy link
Member

Closing for now; if anyone has ideas to tackle this they're welcome.

Until then, the situation is not that bad. It's just a matter of keeping rocksdb in sync with leveldown, usually by cherry-picking commits, and doing it frequently makes it easier.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
discussion Discussion
Projects
None yet
Development

No branches or pull requests

2 participants