Re: What is the logic of storing XML in a Database?

From: Marshall <>
Date: 28 Mar 2007 11:39:42 -0700
Message-ID: <>

On Mar 27, 12:39 pm, "Daniel" <> wrote:
> On Mar 27, 4:15 pm, "Marshall" <> wrote:> On Mar 27, 11:45 am, Bob Badour <> wrote:
> > > David Cressey wrote:
> > > > There are three things you can do with data: process it, store it, and
> > > > transport it. These three are all interrelated.
> > > That seems so limiting like having an emotional vocabulary of happy, sad
> > > and angry.
> > XML makes me sad and angry.
> Well, there are different aspects to XML.
> There really are people who think that XML databases are a good thing
> because they allow you to put data into storage without having to
> model the data, because "everybody" knows that modelling data is too
> hard. Of course, there's that little matter of getting data out
> again, but they have hopes that following conventions for positioning
> some key tags will lead to a good result. These are the same people
> who used to believe that storing name/value pairs in database tables
> was a good thing. I can understand that that would make you
> unhappy.

Exactly. I sometimes say:

  Know schema, know semantics
  No schema, no semantics

> There's also the niggling detail that the standard XML query language
> can return different results depending on whether or not it's a schema-
> aware implementation, and I can understand that that would make you
> unhappy.
> But why would you be unhappy about XML as a transport format? It's
> mostly an improvement over what we had before - CSV files, binary
> formats, etc.

Geeze, I'm tempted to flame, but you asked so reasonably, I'd be embarrassed if I did. (What is it about XML that drives so many to extremes, either pro or anti?)

To answer:

I'm an engineer, and I have deeply held engineer values. I value efficiency. I value simplicity. I value what Josh Bloch calls the "power-to-weight ratio" of a design: how much can you express vs. how much do you have to contend with to do it. Perhaps most of all, I value elegance, which is in part all of the above and in part an ineffable, aesthetic response.

XML embodies the opposite of all of these virtues.

It is wasteful and verbose. It is wildly complicated, and worse, complicated in the face of a task that is fundamentally simple. It is confusing: XPath, XQuery, XSLT, etc. There are two different schema standard, DTD and XML-Schema. The man with one schema standard knows how to structure his data; the man with two knows nothing.


PS. I had a math teacher once who said that a proof was elegant if, when you read it, you wished you had thought of it. Received on Wed Mar 28 2007 - 20:39:42 CEST

Original text of this message