[thelist] XML or a database?

Michael Mell mike at nthwave.net
Tue Jun 11 00:01:00 CDT 2002


I posed the same question to the Python XML list. The XML guru there really
steered me clear of using xml in database functions. Parsing xml involves a
lot of overhead and is quite a bit slower than pulling from a db.

XML is great for passing data among applications/machines that don't have a
native way for communicating. It's great for storing data that seldom
changes and that you want to edit by hand. It's great for portability.

Getting the data you're looking for in xml is little harder than getting
the data you want from a db until you get the hang of it. But that
difficulty may be a result of hierarchical data vs. relational data. Since
XML is hierarchical, you can organize/store xml data in ways that you would
not easily do in a db.

On a site I built which collected and organized links submitted by users, I
used xml to store the link data. When a new link was submitted, the
relevant bits of xml were parsed and the appropriate menus were re-built to
include the new link. The menus were created as includes. The number of new
link submissions was quite low compared to the number of page views. In PHP
at least, placing an include on the page costs less than a db hit, I
believe.

m

Rachel Cunliffe wrote:

> Hiya,
>
> So far I've pretty much stuck to PHP/MySQL for handling data -- but I am
> wondering when I should get into XML.  What are the advantages and
> disavantages of both methods?  If I am not sharing my data with others,
> would you always choose a database over an XML file?
>
> Any comments appreciated!
>
> Thanks,
> Rachel
>
> --
> For unsubscribe and other options, including
> the Tip Harvester and archive of thelist go to:
> http://lists.evolt.org Workers of the Web, evolt !

--
mike[at]nthwave.net
llemekim         YahooIM
415.455.8812     voice
419.735.1167     fax





More information about the thelist mailing list