Tuesday, October 26, 2010

Tree structures in relational database

Into Tree again. I'm a fan of Materialized Path but a bit worried with the limitation to the number of branches. It's ok for something like gov ministry where most of the time the number of agency and department already expected and doesn't change/grow much but with MLM kind of system, we should expect it to expand as wide and depth as possible.

Think better start with adjacency model first (and maybe combined with mat path for easy retrieval). From there it's still possible to move to other models.

http://www.sqlteam.com/article/more-trees-hierarchies-in-sql
http://stackoverflow.com/questions/2797720/sorting-tree-with-a-materialized-path
http://www.ibstaff.net/fmartinez/?p=18

No comments: