cubdb
cubdb copied to clipboard
Abstract storage engine as an option
Hello,
Congrats on the great project! I am using it in something I am developing and thought I would contribute the changes upstream.
I wanted to abstract away the storage engine to be an option. I am using CubDB to build P2P sharable immutable trees: https://github.com/SoCal-Software-Labs/CrissCross
A simple example of how to build a merkle tree with CubDB with these changes:
https://gist.github.com/hansonkd/a0a974704a8483216dca2a1e79c00e62
I think this is really powerful because it allows you to abstract KV stores on top of whatever backend you want (you can add layers of caching or other middlewares too)
In addition the location type should be dependent on the store. That way a store can have whatever location object type it wants.
Hello @hansonkd !
Thanks a lot for your contribution. I want to take time to review it properly these days. I am already working on the option to add caching to the Store
(work is not pushed yet), so I am interested in options to make details about the backend configurable.