Actually what I need is very simple: A mutable tree.
Each tree node has a payload (JSON) and an ordered list of children. I need to be able to add/remove children from any node, and update the JSON on any node. My tree however may be 100s of levels deep, so approaches that require me to modify a parent node every time a child changes would not perform well enough. Obviously a Merkle tree is out because it does require a traversal too the root any time any node changes, to update the hashes of all ancestors/parents. My operations on add/delete/update need to operate in constant time (nearly) and therefore cannot be proportional to tree depth, so it’s a challenge.
My current implementation is a MongoDB database where each node (mongo document) has a “path” property, and that path is where the tree structure is derived from, but i wanted to get to where I can perfectly represent the DB in IPFS for various purposes.
I am aware of Orbit DB but frankly their keystore is just a key store, and can’t do mutable trees just like IPFS itself can’t do mutable trees. (other than merkle snapshots of trees). If IPNS however were high-performance (minutes won’t cut it) that actually would allow ‘trees’ to be implemented, because each tree node could have a fixed CID…and avoid the ‘chain reaction’ of updating each parent.
TL;DR: Is MFS (Mutable File System) the best way to achieve a ‘mutable tree’ even if you don’t really need ‘files’, but just JSON chunks.