XML vs. rel DBs [was: Re: [nycphp-talk] Many pages: one script]

Jeremy Mcentire jmcentire at
Wed Aug 8 14:50:33 EDT 2007

>> The best thing about XML is that it is really is just a flat file  
>> and everything in it has a beginning and an end. I cannot think of  
>> anything that one would want to store in XML that cannot be stored  
>> in a db and that also cannot be stored in a text file with way  
>> less overhead. Examples are welcome.
> You need to remember we're talking about XML databases that store  
> collections of XML documents, not simply a single XML document. A  
> single relational record can be easily stored in a tab-delimited  
> text file with way less overhead too. But when you have millions of  
> these things that you have to sort, search, update, backup, specify  
> access permissions, and so forth, then the database begins to show  
> its worth.
> With that in mind, consider:
> The Encyclopedia Britannica
> The collected publications of O'Reilly Media
> The complete work product of Skadden-Arps
> The New York Times
> The collected works of William Shakespeare and other Elizaebthan  
> dramatists
> Then consider that you want to be able to make queries like, "Find  
> all the paragraphs containing both the words 'Bush' and  
> 'incompetent'" so you can't just shove everything into a BLOB.

Not to mention that the utility of XML is not simply inherent in it's  
being small.  No one is claiming that it is small.  But, there is  
utility there that makes it worth the size.  There is always a  
tradeoff.  To complain about XML because it takes more characters to  
store data or lays it out in a manner that isn't the same old RDBM  
isn't valid.  I'd entertain it if I thought you wrote code in a  
binary format the machine understands natively.  I don't think you  
do.  All that wasted white-space... for shame.

*Grin*  Seriously.  With any abstraction comes overhead and a loss of  
flexibility or power.  XML doesn't do everything perfectly.  But, it  
fits a lot of things well-enough.  *Shudder*  I sound like an  
engineer now rather than a mathematician.  Yet, it is a valid  
argument, I suppose.  I've heard it enough times now to repeat it.


More information about the talk mailing list