Storing Hierarchical Data Using Nested Set Model

Since I started my career in web development, I've had to deal with storing of Hierarchical data. For years I've been using the adjacent model (recursive structure). This is where you have a record in a table that relates to another record in the same table. It's very easy to work with when you're doing the logical design of the database and also when you're inserting into the table. If you know the depth of the relations than it's still fairly easy to work with. The problem comes when you have no idea of the depth and still need to extract and/or display this hierarchical relationship.

Syndicate content