[kdewebdev-webdeveloper] test

Eric Laffoon eric at kdewebdev.org
Thu Mar 6 23:37:55 EST 2008


On Thursday 06 March 2008 2:32:30 pm Andrew Lowe wrote:
> I am not really sure if the XML will be faster or slower... I am not a fan
> of storing data in XML or even transferring in XML - I prefer traditional
> comma separated text, but I am coming around to the idea as it can be very
> useful.

One should keep in mind the purpose of a technology. XML is intended to be a 
data technology that is free form and text based. Right there you have your 
answer. Databases are rigid form and designed to have high throughput with 
precision. XML can be imprecise but it's going to require costly parsing. 
Here is another perspective. XML is a subset of SGML. HTML is a subset of 
XML. Your HTML processing is hard coded and highly optimized. Your database 
processing is hard coded and highly optimized. By definition at least a 
significant part of your XML processing will be niether.
>
> I tend to deal with very dynamic data with users adding new data and
> reading very often, so stick with database.

If you need real data control, relational data and throughput PostgreSql is 
great. If you need to cope with XML quickly PHP5 simplexml is very nice.

The thing to remember is why you choose XML, HTML, and databases. Likewise 
whether a text file or a database query is faster is another loaded question. 
The database resides in the file system, but does PHP open a process to read 
it and how does that compare to the loaded process in Apache? Whatever 
nominal speed advantage a file might have evaporates when you begin parsing 
it with a scripted language as opposed to a highly optimized query in a 
compiled language. It's probably not too different on a limited basis, but as 
complexity grows it is. Ironically as complexity grows, even if it were worse 
instead of better, the potential for bugs to arise would make up for it.

Probably the strongest argument for choosing one over the other is what your 
data looks like. If it's very free form you want XML. Otherwise using a good 
database is going to deliver higher throughput and reliability.

-- 
Eric Laffoon
Project Lead - kdewebdev module


More information about the kdewebdev-webdeveloper mailing list