nano-node icon indicating copy to clipboard operation
nano-node copied to clipboard

Automatic database backend

Open RickiNano opened this issue 4 months ago • 1 comments

Switching database backend between LMDB and RocksDb is currently done by setting RocksDb.enabled to true or false in the config.

This PR removes that setting and adds a new Database_backend config setting. Database_backend can be set to one of the following:

  • lmdb
  • rocksdb
  • auto

The first two will force the use of the specific backend. When using auto mode the node will look for an existing ledger and use this. If no ledger is found it will initialize a new ~~RocksDb~~ LMDB ledger. If multiple ledgers are found it will display a warning message and use the RocksDb ledger. The main purpose is to make new node operators use RocksDb but without forcing existing LMDB users to make changes. In future node versions (V29?) we can show messages to LMDB users that encourage them to update to RocksDb and instructions on how to do this. Even later versions (V30?) could halt the node initialization if LMDB is used and display instructions on updating. If they insist on using LMDB they can set Database_backend to lmdb

RickiNano avatar Oct 15 '24 08:10 RickiNano