Forum Moderators: coopster
I'm building a directory and am settling on what database design to use. I noticed that yahoo includes their directory structure in their path instead of just referring to a directory ID. For SEO reasons I want to do this also.
Now this makes me wonder how yahoo structures its database. Does it include the whole directory path into one field?
This sees too bulky to me.
Or does Yahoo explode the the url path and and use some advance sql gymnastics to loop through parent to child directories.
I'm guessing the latter is the case. If so, does anyone have a clue how to structure and query such a database design?
Large and busy directories will almost without exception be served out from static pages (or more likely included static pages within a higher level dynamic "My Yahoo!" style script) that have been generated in a background process from the database that holds the source data for the directory.
As for your database structure, search on "Modified Preorder Tree Traversal" for ideas on how to structure your hierarchy for efficiently working out the path to a node etc.
As for storing directory entries at nodes; the "straight forward" way to do it would be to simply store the node ID in your directory entries table. If nodeID is indexed then selection will be extremely fast.
Cheers,
Jeff