[thelist] Database vs. Flat file vs. XML

Jonathan_A_McPherson at rl.gov Jonathan_A_McPherson at rl.gov
Thu May 23 14:59:04 CDT 2002


Burhan,

That's quite a complex question. (-:

Databases management systems (DBMS's -- Oracle, SQL, MySQL, Postgres, etc)
have certain features that you can't get with a flat file or XML. When those
features become important, you use a DBMS. When they are not important, you
can probably downgrade. Some of the obvious reasons to use a DBMS:
* Speed. Modern DBMS's build indices and have very advanced routines for
getting you data as quickly as possible.
* Management of relational entities. DBMS's are good at storing data about
multiple, related entities.
* Transaction and liveness guarantees. DBMS's allow you to protect your data
-- back it up, be able to roll back unwanted transactions, ensure that a set
of operations on data executes atomically, etc.

I'm sure I'm missing a few important ones -- those were just the ones that
came to mind. Others on the list will supply additions, I'm sure. (-:

For your quote file, is speed a problem when you use a flat file? Do you
have relationships between quotes you need to manage? Do you need a very
reliable transaction-based system for maintaining your quotes?

Ask yourself what important (for *your* app) features a DBMS is getting you
that a flat file or XML wouldn't. Then ask yourself what it's costing you
(in terms of maintaining the DBMS software, added code for your app, etc).
Then ask yourself if those costs are worth the benefits you are getting.
That's a decision only you are qualified to make.

I shouldn't lump "flat file" and "XML" together -- to me, a "flat file"
implies storage of entities of a single type, whereas "XML" is a structured
format that stores multiple types of entities and their hierarchical
relationship. In those contexts, XML can do what flat files cannot, but it
is still best thought of as another kind of file format.

FWIW, I almost always use a DBMS, because I almost always find that it does
something I need to do that I wouldn't be able to do as well on my own --
but that might not be the case for your app. DBMS's are wonderful tools, but
they are not always necessary and sometimes can add needless complexity to
your application.

Jonathan.


-----Original Message-----
From: Burhan Khalid [mailto:burhankhalid at members.evolt.org]
Sent: Thursday, May 23, 2002 12:25 PM
To: thelist at lists.evolt.org
Subject: [thelist] Database vs. Flat file vs. XML


--
[ Picked text/plain from multipart/alternative ]
Hello Listees :

    All this talk about databasing has me thinking, what the advantages of
databases over say an XML file or a flat file for simple projects. I had a
collection of quotes in a database, which I moved to a flat file (since it
was, imo, overkill). When does data require the use of a database? Does it
have to do more with the content, or the application?  In your
experience(s), have you ever had to move stuff away from database to a
simpler system(s)? I know lots of people go the other route, but when would
it be better to "downgrade"? Short of moving to a host that doesn't have
your favorite database, or for backup, are there any other reasons to go to
flat-filing?

Your opinions are always great,
Burhan
--



More information about the thelist mailing list