Hi all,

I've been playing around with the concepts mentioned in this article:
http://www.sitepoint.com/article/hierarchical-data-database/

(Short summary: Using Modified Preorder Tree Traversal, resulting in "left and right" values for each tree node to describe the tree structure)


With all this in mind, I'm hoping to emulate a "folders and pages" hierarchical structure for a CMS, without relying on the file system at all.


Here's where I get stuck:

In a simple tree, one can easily see that using the title of a node as it's primary key is not smart... names can easily collide:

Root
        Products
                ProductOne
                        About
                        FAQ
                        Support
                ProductTwo
                        About
                        FAQ
                        Support
        Services
                About

As the writer of the article suggests, numeric IDs are the way to go. However, I want to call the tree via the URL with name-based ID's (eg /products/product-one/about/) rather than numeric IDs (eg /2/17/44/).

A further complication is that this data design would allow two nodes in the same parent node to have the same title, since the numeric key is the ID, rather than the title.


When we look at a traditional file system, it's based on unique keys AT EACH TREE LEVEL, not unique keys for the entire tree. As such, I don't think the above data model is right for this application.


The only catch is I have no idea where to look next. Hours of Googling has returned very little.

Any hints on where to look next would be great.


--- Justin French http://indent.com.au


-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to