Is there a way to change keys in leveldb?

Is there a way to change only the value of the keys in the leveldb database?

I already have a database with 18 milion rows, and I would like to change the keys to add a prefix.

I am using leveldb with node.js. But any decision must be consistent.

I already tried to rebuild this database, but it is too expensive.

+3
source share
1 answer

How LevelDB works, each "Put" is a record that creates a new state. If you follow a Path that overwrites an existing value, you will have two copies until the compaction removes the older value.

In practice, this means that recovery will be the only option.

To make it faster, you can try:

  • , . , .

  • . LevelDB . LevelDB 1 , , .

  • . 16MB-32MB, " ".

  • HyperLevelDB. LevelDB . , , - .

+4

All Articles