6

Since 0.8 bitcoind uses LevelDB for the storage of the UTXO set in chainstate/ and the block index in blocks/index/. On github special branch of LevelDB can be found:

https://github.com/bitcoin/leveldb

What reasons made LevelDB the best choice for key-value storage compared to other embedded database solutions? How does bitcoind's own LevelDB fork differ from the official version?

1 Answer 1

7

The fork serves two purposes:

  • Local modifications that are hard to bring upstream:

    • Windows support (which is partially based on the existing Windows port, but needed changes for building in MinGW)
    • Removal of compression support, as it doesn't help, and complicates the build.
  • Strict control over changes. Given the previous experience with the BDB to LevelDB changeover that caused a fork in the network, it is wise to not use system-wide installed versions of the library. Hypothetically, even if a change is a bug fix from the point of view of LevelDB, we may want to maintain the buggy behaviour to prevent a fork in the network, depending on the bug.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.