Closed davebryson closed 5 years ago
It looks like you may be removing the get_node closure in favor of a Trait. Is that correct?
That's right, it feels a little more rust idiomatic to pass around a struct which has a trait method, rather than passing around a closure.
There'd be a corresponding TreeWriter. Both could then be implemented by RocksDB, etc... Is this kind of trait approach direction you're heading?
I'm not a fan of trait-ifying every DB operation since there are many which will be hard to replicate outside of RocksDB, e.g. checkpointing, optimisitic transactions, etc. I do think it makes sense for reading to be a generic interface however, since we could also maybe pass in a caching layer or something like that.
Closing this, but leaving #11 open for discussion around this kind of database abstraction.
Just trying to follow along with your direction... It looks like you may be removing the
get_node
closure in favor of a Trait. Is that correct?I've been experimenting with something similar on my own local branch. Removing
get_node
for aTreeReader
trait. Something like this (although I broke things pretty bad in the process):There'd be a corresponding
TreeWriter
. Both could then be implemented by RocksDB, etc... Is this kind of trait approach direction you're heading?