Hacker News new | ask | show | jobs
by afandian 1569 days ago
Once you're into a relational model you can start treating your forest of trees as a big graph if you want to (though you don't have to). And you can edit nodes individually without having to iterate the entire document.

But assuming you're trying to maintain the tree structure you still have many of the same issues. Each node will need to entail the context of its parent, which means that you'll need to know things like transitive closures in order to know if a parent node affects a child (e.g. deletion) or if a child affects a parent (e.g. re-render tree). Or if you move a node do you have to re-create pointers below it? And tracking history could get complicated because it might span both the content of the node and the tree structure metadata (e.g. can you undo a change where the text was bold and a block was moved around). Where do you put transactions?

I'm not saying this is the same as XML, just that you can't magically escape all of the downsides. It's a fun problem to solve!