A few days ago I started the development of a new version of my CMS. In that case I also wrote an article about Test Driven Development (TDD) with the Zend Framework. But TDD is another topic. Today I’ll take a closer look on a special technique called “Nested Sets“. Nested sets are used to manage hierarchical data. Instead of walking through the results of a database in an recursive way nested sets providing the possibility to avoid recursive calls. Therefore the response time of an application can be increased extremely by using nested sets.
All beginnings are difficult
The first time I heard about nested sets (I must confess that that was only a few days ago) I thought using nested sets is very complicated. But once understood the technique behind nested sets suddenly the technique looks easy, user friendly, powerful and high-performance. But it’s one thing to understand a technique by yourself and a completely another thing to explain what is going on the another person, I guess. Therefore instead of providing an own tutorial I rather provide a couple of brilliant links. Some of these resources are in German. I know that this is not very comfortable for people who don’t speak German. But these resources are really amazing. And the source codes are written in English,m of course. So if anyone would have a question regarding one of the German resources I linked just leave a comment and I’ll get back to you.
Excellent articles
- Joe Celko: Trees in SQL [english]
- Nested Sets – Verschachtelte Bäume mit MySQL [german]
- Nested Sets – Hierarchische Strukturen und Bäume in MySQL [german]
- Managing Hierarchical Data in MySQL [english]
no comment untill now