I’ve implemented an abstraction layer on-top of badger with convenience functions like nodes and lists. I’m trying to get paging correct and am hoping to get some expert opinions if this is the best way to go about this.
The BadgerNode has a prefix on the iterator to make sure that only valid keys are parsed and not more nodes. One optimization would be if I could exclude certain keys, specifically keys that end with a suffix. We have key prefix, why not key suffix?
Another optimization might be to store the node keys as another entity and retrieve them on node creation. Although, I like the simplicity of the nodes only writing to the database if the nodes themselves have values stored, if something creates a database node but never writes to it, there is no database access.