4 ms·
I maintain an old cms that stores the id of the parent, left sibling, and right sibling. Making any changes to the order or grouping is wrought with peril beca
by cuddlyogre 3y ago
I maintain an old cms that stores the id of the parent, left sibling, and right sibling.
Making any changes to the order or grouping is wrought with peril because you never know if everything is going to be updated properly. When it isn't, it's an ordeal to correct.
Having a parent id and sort order is straightforward and about as simple as it gets. I really don't see why you'd need to do it any other way outside of a thought experiment.
- noizejoy 3y agowe used to call that a "linked list"[0] [0] https://en.wikipedia.org/wiki/Linked_list https://en.wikipedia.org/wiki/Linked_list
- Izkata 3y agoThey have a parent node, that really isn't describing a linked list.
- noizejoy 3y ago> They have a parent node, that really isn't describing a linked list. Indeed - you're absolutely right. Not sure if the comment I responded to was edited to add the parent node after my post or if I just overlooked it, but I should have quoted that I was just referring to the left and right siblings (i.e. two linked lists): > an old cms that stores the id of the ... left sibling, and right sibling.
- plonq 3y agoThats called Modified Preorder Tree Traversal and the reason to use it over simple parent ID and order is performance.
- cuddlyogre 3y agoThank you for explaining it. I'm curious if it's just a bad implementation.
- mixmastamyk 3y ago> never know if everything is going to be updated properly Use a transaction.