XML overuse? (was Re: Python to XML to Python conversion)

Jonathan Hogg jonathan at onegoodidea.com
Fri Jul 12 11:11:34 EDT 2002


On 12/7/2002 15:03, in article QkBX8.72747$vm5.2639597 at news2.tin.it, "Alex
Martelli" <aleax at aleax.it> wrote:

> Somebody else commented that "XML databases" are a good idea
> because some programmers are bad at designing relational schemas.
> <shudder>. 
> 
> Now THAT is an idea that sends shivers down my spine.
> Maybe I'm just too pessimistic, but I'd really like to look at
> the relational schemas autogenerated from DTD's or whatever --
> and if the underlying relational stuff isn't there, or isn't at
> all accessible, then please include me out of such plans.

Heh. Now that would have been me ;-)

Except what I actually said was:

> Also, XML databases can be used and make a lot of sense if the data can be
> arbitrarily structured. People are often very poor at designing relational
> schemas.

If the data is complex and hierarchical then a good relational schema is
going to be very hard to produce, and thus more likely than not going to be
done badly.

XML databases can be built (as can most data repositories) on top of an
RDBMS, but often they are pure databases similar to an OODB - this is
because relational databases aren't fundamentally very good at managing
arbitrary hierarchical information, which was my point.

Hierarchical data is also not well-suited to relational querying (Oracle's
"START WITH ... CONNECT BY" being the best attempt I've seen at it), which
is why XML querying languages like XPath and (soon) XQuery exist. An XML
database is best thought of as a hierarchical filesystem of XML files.
Except that, unlike a filesystem of XML files, the database can maintain
indices and a layout that enables optimised querying of fragments of
multiple documents.

For a reasonable example, take a look at Apache XIndice:

    <http://xml.apache.org/xindice/>

One should be wary of getting stuck in one mindset - even if it is a very
good one ;-)

Jonathan




More information about the Python-list mailing list