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

feature: implement the db interface with goleveldb

Open p4u opened this issue 3 years ago • 3 comments

Describe the feature Implement the db package interface using goleveldb (next to badger).

Motivation Compare badger with goleveldb.

Proposal

  • [ ] Add a new package implementing the same interface badgerdb does, but using goleveldb.
  • [ ] Add a flag --dbBackend for choosing among existing db implementations (badger and leveldb).
  • [ ] Make the flag set the packages statedb/statedb.go and tree/tree.go to use the database selected

p4u avatar Oct 05 '21 20:10 p4u

There's also https://github.com/etcd-io/bbolt, a port of LMDB, as opposed to goleveldb's LevelDB:

If you require a high random write throughput (>10,000 w/sec) or you need to use spinning disks then LevelDB could be a good choice. If your application is read-heavy or does a lot of range scans then Bolt could be a good choice.

Software-wise, I'd tend to prefer relying on etcd's bbolt, as etcd is a large project with enough people to test and maintain it. I think goleveldb has comparatively fewer resources.

mvdan avatar Oct 05 '21 20:10 mvdan

@mvdan any updates about this issue ?

jordipainan avatar Mar 03 '22 11:03 jordipainan

I'm currently focusing on replacing badgerhold, which I think is more urgent. Once we've removed badgerdb from the scrutinizer, then it will make more sense to stop relying on badger as a KV database elsewhere.

mvdan avatar Mar 03 '22 11:03 mvdan

FYI, badger is removed from the db package now. The only "production" implementation we have now is with https://github.com/cockroachdb/pebble. It's worked well for over a year at this point, so I don't personally see a reason to stop using it or consider alternatives.

mvdan avatar Feb 06 '23 10:02 mvdan