[thelist] Proper DB Table Design...

Travis travis at mediastill.com
Mon Sep 13 12:10:51 CDT 2004


Hi Mathias, thanks for the reply,

> Only of course that you will probably have
> to maintain the uniqueness yourself.

That's true, but it's not that hard to do so - in fact I already have it
implemented.  This is one of these situations where I found myself 2nd
guessing my methods after I already did all the work (grin.)

> Before you plunge into the 'adjacent list' model, also consider the
> following articles on the subject:

I've looked at some of those other models already actually, but they all
seem quite a bit more complicated than the adjacent list model.  Anyhow, I
think they might be overkill for my purposes (the tree is never more than 4
levels deep and will only contain a few hundred items), so while I will
certainly try to get more comfortable with some of these other methods for
the future, for the time being I think I'd prefer to stick with an adjacent
list - it makes the most sense to me.

thanks!

-travis




----- Original Message ----- 
From: "Mattias Thorslund" <mattias at inreach.com>
To: <thelist at lists.evolt.org>
Sent: Monday, September 13, 2004 9:40 AM
Subject: Re: [thelist] Proper DB Table Design...


> Travis wrote:
>
> >It just seemed a little strange having to have unique values across 2
> >tables, is all.
> >
> >
> >
>
> It isn't so strange to me.  Only of course that you will probably have
> to maintain the uniqueness yourself.  Depending on your RDBMS, you might
> be able to use a check constraint that can enforece it, but at what
> performance cost I have no idea.
>
> Before you plunge into the 'adjacent list' model, also consider the
> following articles on the subject:
>
>
http://www.evolt.org/article/Four_ways_to_work_with_hierarchical_data/17/4047/
> http://www.sitepoint.com/article/hierarchical-data-database/2
>
> Also, since you have two types of nodes in your hierarchy, an
> alternative design for that would be to use a 'Nodes' table for just the
> hierarchical ordering (according to one of the models above).  Then add
> a NodeID Foreign Key column to both your Documents and Categories
> table.  That would also ease your pain if you should ever need to add
> another type of node ("Links"?)...
>
> /Mattias
>
> -- 
>
> News! - Evolt.org conference for web professionals.
> 17-19 September 2004 in Toronto, Canada.
> Details at http://TOevolt.org
>
> * * Please support the community that supports you.  * *
> http://evolt.org/help_support_evolt/
>
> For unsubscribe and other options, including the Tip Harvester
> and archives of thelist go to: http://lists.evolt.org
> Workers of the Web, evolt !


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.745 / Virus Database: 497 - Release Date: 8/28/2004



More information about the thelist mailing list