title: Storing Composite Patterns (Hierarchical Data) in Database
body: <p>What are 'best-practices' for saving Composite patterns in a Relational Database?</p>
  
  <p>We have been using Modified Preorder Tree Traversal. This is very quick to build the whole tree, but very slow to insert or delete new nodes (all left and right values need to be adjusted). Also querying the children of a node is not easy and very slow.</p>
  
  <p>Another thing we noticed is that you really have to make sure the tree doesn't get messy. You need transaction locks, otherwise the left and right values can get corrupt, and fixing a corrupt left right tree is not an easy job.</p>
  
  <p>It does work very good however, the Modified Preorder Tree Traversal, but I was wondering if there are better alternatives.</p>