[thelist] FSO Vs. DB

Joshua Olson joshua at waetech.com
Sun Apr 14 02:30:01 CDT 2002


----- Original Message -----
From: "Ken Kogler" <ken.kogler at curf.edu>
To: <thelist at lists.evolt.org>
Sent: Sunday, April 14, 2002 3:00 AM
Subject: [thelist] FSO Vs. DB


> Allrighty, here's one for ya:
>
> I've got a template page with dynamic content. What are the pros/cons of
> storing the content in individual files versus a database?

Ken,

The setup you are talking about is fairly common.  Like you've implied,
there are some pro's and cons.

Pros:
- Users can easily be given the option to FTP their own files into the
system
- Potentially faster processing (the OS should be fairly optimized to load
text files)
- Can be indexed (for online searching) via the folder structure, though it
can be difficult to translate files back to url's
- No worry about length of data or character set of data
- Data is accessible even if the web server and/or database server are
offline
- Easy to make quick changes via notepad if really pressed for time

Cons:
- The data is no longer in the database and must be backed up separately
- Must have technique to relate file with a record -- sounds like you've got
this covered
- Cannot search the text usng database tools -- most databases only allow
LIKE on long text fields, and some search CASE-SENSITIVE only, so  this may
not be a huge loss.

Ok, so the cons list isn't very long.  My experience with using external
files (away from the db) has been a pretty good one thus far.  Since large
blocks of text are not fields involved in relationships within databases,
there is no real reason that the data even needs to be in the database.
Using the file system like an external table is perfectly reasonable.

> The main issue here is editing the content that gets brought into the
> templates. The Boss thinks that having it in separate HTML files will
> allow people to open up "their" files in FP or DW, and edit away. I view
> this as more of an admin nightmare.
>
> Putting the content into a db and slapping a web front-end for editing
> on it gives me the control I need, with only a slight hassle to the user
> (using web-based editing, rather than a client side proggie like FP/DW).

Keep in mind you can create your own web-editor regardless of wether the
data is stored in the database or on the file system.  It's only up to you
to load the data manually instead of with the query.  I doubt very highly
that you'll find storing the files on the disk any more difficult to work
with than storing them in the database.  In fact, you'll possibly even find
it easier to work with in the long run since you don't have to worry about
database related issues such as character sets, escaping of single quotes,
field size limitation, etc.

As far as interfacing with FP/DW... uh... that's totally up to you.  Storing
the text in the database prohibits this interface altogether, while storing
files in the file system allows it.  However you want to argue the choice is
up to you... just keep in mind that you will not be limiting yourself much
(except in regards to "searching" the data) by going with the file system
implementation.

HTH and Good Luck,
-joshua





More information about the thelist mailing list