Level / rocksdb

Pure C++ Node.js RocksDB binding. An abstract-leveldown compliant store.
MIT License
230 stars 54 forks source link

rocksdb vs level-rocksdb #167

Closed cisaacson closed 3 years ago

cisaacson commented 3 years ago

We are using level-rocksdb 4.0.0, it uses a very old version of rocksdb. Looks like this npm package (rocksdb) is meant to replace it and uses the latest version of rocksdb. Any reason we should not switch to the rocksdb package?

vweevers commented 3 years ago

level-rocksdb will soon be updated too (https://github.com/Level/community/issues/98) and is recommended over direct use of rocksdb:

It is strongly recommended that you use [the] levelup [interface] in preference to rocksdb unless you have measurable performance reasons to do so. levelup is optimized for usability and safety. Although we are working to improve the safety of the rocksdb interface it is still easy to crash your Node process if you don't do things in just the right way.

cisaacson commented 3 years ago

Thanks @vweevers for the quick response, we will wait until level-rocksdb is upgraded.

buu700 commented 3 years ago

@vweevers What's the benefit of using level-rocksdb over levelup + rocksdb (aside from convenience)?

I see in the text you quoted that levelup is recommended over using rocksdb directly, but I don't see that the level-rocksdb wrapper itself is recommended. I also see that the npm package hasn't been updated in two years, which makes it seem like it may be (or maybe should be) deprecated.

vweevers commented 3 years ago

What's the benefit of using level-rocksdb over levelup + rocksdb (aside from convenience)?

It also includes encoding-down. Other than that, yes, it's just convenience.

I see in the text you quoted that levelup is recommended over using rocksdb directly, but I don't see that the level-rocksdb wrapper itself is recommended.

We could improve those docs somewhat; it should say that using level-rocksdb is recommended over using rocksdb directly, because the level-rocksdb package wraps it in a safer levelup interface.

I also see that the npm package hasn't been updated in two years

I just released level-rocksdb 5.0.0.

cisaacson commented 3 years ago

@vweevers Congratulations on getting the new release out, I know it was a huge effort.

buu700 commented 3 years ago

Got it, thanks for clarifying all that!