Meeting - Tuesday Nov 19

Darren Duncan darren at DarrenDuncan.net
Fri Nov 15 11:09:52 CST 2002


On Thu, 14 Nov 2002, Liz or Rockie Lowe wrote:
> I would be interested in comparisons between the use of XML and relational
> database models. I don't have a specific questions, just a general interest.

Sure, I can do that, since I have at least a year's experience in both.
The short answer is that an XML document or an XML DOM is a tree structure
with one root and many branches; while a relational database can emulate
this, a relational database is more like a web where you can have multiple
roots as well.  As far as implementation goes, XML is stored on disk as
text files, sort of like html but more generic, while relational databases
are more like a set of hashes and trees.  XML is better suited for small
amounts of data when you want to read all the XML data into memory at
once; you have to parse the whole document in order to know how to find
any data in it.  Relational databases are better suited for when
you have a huge amount of data and you can't or don't want to read it all
into memory every time.  This said, once the XML is parsed in memory as a
DOM, you can use XPATH expressions to fetch any data in it just as easily
as an SQL expression can fetch anything in a relational database.  So, I
know all about theory for both XML and relationals, but I haven't actually
used the Perl libraries to deal with XML before (I have read about them)
so I don't know which are best for particular tasks (my coding for XML
was in a different language).  I have actually used DBI.pm to talk to
MySQL though, so I know specific Perl code for doing that. -- Darren
Duncan




More information about the Victoria-pm mailing list