List:General Discussion« Previous MessageNext Message »
From:David T-G Date:August 31 2004 10:35am
Subject:db design for hosting site
View as plain text  
Hash: SHA1

Hi, all --

I have a web hosting picture gallery service at

and am thinking about how to do the next version, which will store the
media files in the filesystem but pretty much every thing else in a
database (like it should be :-)  I wonder about table design -- amongst
other things, of course.

Each customer will have some internal information (billing and contact
info, etcetc) as well as external information (who s/he is, contact info,
etcetc) and then will have metadata (comments, time/date, etcetc) about
the pictures.

One thing I want to offer is the ability to load balance / mirror a site
on another of our servers.  Another that might be neat is the ability to
export/expose a certain set of one's files to someone else to import to
share content.  Other than that, as far as I can see each customer will
be unique on each host and unique across the enterprise.

Since I want the ability to mirror, it seems that I'll probably want one
single DB replicated across my hosts so that comments and so on stay up
to date (I still haven't crossed the bridge of how to keep the library
itself in sync thru something like unison or rsync, but I do know that I
really don't want to keep the files in the DB itself).  I'm open to ideas
of why I wouldn't, though.

My real question comes down to table layout.  Given the customer data as
above (in much more detail, of course), I'm not sure whether I want a
table structure for each customer (presumably instantiated as part of the
site setup, but perhaps created by the code in a "check this first before
you do anything" section) or a single large table structure.  The latter
seems more straightforward to me, and since it's a DB it shouldn't matter
if the 'pictures' table (or the like) gets to be a million rows, but what
I don't know about DB design would fill a book :-)

This is a talkative list and I wouldn't be surprised to find lots of
chatter back and forth on the matter, but I'll summarize what I learn
and/or decide when the conversation or direct emails wind down.


- -- 
David T-G
davidtg@stripped      Shpx gur Pbzzhavpngvbaf Qrprapl Npg!

Version: GnuPG v1.2.4 (FreeBSD)

db design for hosting siteDavid T-G31 Aug
  • Re: db design for hosting siteMartijn Tonies31 Aug
    • Re: db design for hosting siteDavid T-G31 Aug