perlmeditation
Hero Zzyzzx
<p>Monks,<br>
I've just released my first module to CPAN, <a href="http://search.cpan.org/~djcp/DBIx-Tree-NestedSet-0.10">DBIx::Tree::NestedSet.</a> It implements a nested set tree that uses DBI for storage. For more information on the theoretical advantages of a nested set tree, see <a href="http://search.cpan.org/~djcp/DBIx-Tree-NestedSet-0.10/lib/DBIx/Tree/NestedSet.pm">the POD</a>, especially the <a href="http://search.cpan.org/~djcp/DBIx-Tree-NestedSet-0.10/lib/DBIx/Tree/NestedSet.pm#SEE_ALSO">See also</a> section for more in-depth information.</p>
<p><b>The quick version:</b> Nested set trees allow you to find parents, children, and siblings of nodes in a tree with one SQL statement at the expense of more "costly" updating. Given that most webapps fall into the "many reads, few writes" model a nested set tree can offer significant performance advantages over the typical adjacency list model. </p>
<p><a href="http://search.cpan.org/~djcp/DBIx-Tree-NestedSet-0.10/lib/DBIx/Tree/NestedSet.pm">DBIx::Tree::NestedSet</a> includes a [cpan://CGI::Application] and [cpan://HTML::Template] based "helper class" named <a href="http://search.cpan.org/~djcp/DBIx-Tree-NestedSet-0.10/lib/DBIx/Tree/NestedSet/Manage.pm">DBIx::Tree::NestedSet::Manage</a> that gives you a CGI (or mod_perl) based interface to your nested set tree, partially to be useful and partially to demonstrative of the API.</p>
<p>Rather than me blathering on repeating what's already in the documentation, please look at the POD and the <a href="http://search.cpan.org/src/DJCP/DBIx-Tree-NestedSet-0.10/README">README</a> for further info.</p>
<p>I'm looking for folks to test this on other RDBMSs and patches are always welcome.</p>
<p>It's a testament to the mighty CPAN (or a slight on my skills. . .) that I've been programming perl for over 5 years and this is the first module I've needed/wanted that wasn't already up there in one form or another.</p>
<!-- Node text goes above. Div tags should contain sig only -->
<div class="pmsig"><div class="pmsig-59531">
<p align="right"><font size=1 face="Verdana, San Serif"><b> -Any sufficiently advanced technology is<br> indistinguishable from doubletalk.</b></font></p>
<p align="right"><font size=1 face="Verdana, San Serif"><a href="http://www.geekuprising.com">My Biz</a></font></p>
</div></div>