LISTSERV mailing list manager LISTSERV 16.5

Help for XML-L Archives


XML-L Archives

XML-L Archives


XML-L@LISTSERV.HEANET.IE


View:

Message:

[

First

|

Previous

|

Next

|

Last

]

By Topic:

[

First

|

Previous

|

Next

|

Last

]

By Author:

[

First

|

Previous

|

Next

|

Last

]

Font:

Monospaced Font

LISTSERV Archives

LISTSERV Archives

XML-L Home

XML-L Home

XML-L  December 1998

XML-L December 1998

Subject:

Re: storing XML documents on relatioanl database

From:

Mark Birbeck <[log in to unmask]>

Reply-To:

General discussion of Extensible Markup Language <[log in to unmask]>

Date:

Thu, 17 Dec 1998 17:31:23 -0000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (121 lines)

Sam Wrote:

>>Sam Hunting wrote:
>>
>>> Can I translate this as follows:
>>>
>>> This approach allows XML data to be stored and retrieved
>>> to granularity limited only by the XML instance, using existing
>>> relational technology, with no performance penalty?
>>
>>That was a translation? ;)
>
>Yes, I think it was. It was a serious question, at least.

No offence Sam! Just I had to read it three times - my fault for being
dim though.

> I'm trying to
> understand where the dividing line (if any) is between the relational
world
> and the SGML world

I have no theoretical knowledge on this, so probably cannot help.
However, if our experience is of any use, I'd venture the following
opinions:

- The 'relational world' is useful for efficient storage of connected
data. However, I would just treat it like a file-system. Build a layer
on top of it and then forget about it. The Holy Grail is objects.
- Once you have 'objects' (admittedly stored in a relational database)
you can manipulate things very easily. XML (I know nothing of SGML)
falls out frighteningly easily.

So, the 'dividing line', (if any) of interest to me is that separating
objects and XML.


> working from the assumption that content that's worth
> normalizing goes in the database, and content that isn't, doesn't.

Again, very interesting. I can only refer you to my comments on the
Oracle document on XML in relation to normalising. Again, my theoretical
knowledge is limited, but I think that normalising is beginning to mean
something different to what it traditionally does. To me what is of more
interest is that two apparently different pieces of data are known to
convey the same meaning:

"You owe me twenty <CURRENCY ISO="USD">bucks</CURRENCY>", said the
debt-collector. "I can give you ten <CURRENCY
ISO="USD">dollars</CURRENCY> now", I replied. "Please don't break my
legs."

(Hey, it's nearly Xmas - forgive me if my imagination wanders!)

Now that isn't traditionally what we'd mean by normalisation - and maybe
it isn't what we mean now either - but it implies to me that just about
everything could benefit from going into a database.



> You seem to have thought through an approach to this design problem,
so I'm
> interested to understand it.

> So, (1) Here is what I see as a claim of unlimited granularity:

> "allows you to distribute any node in the tree"

> And (2) since you don't mention performance issues... I assume there
aren't
> any ;-)

It is surprisingly fast. For example, retrieving an object is pretty
easy. If we have:

<COMPANY>
        <NAME>IED</NAME>
        <ADDRESS>
                <STREET>39 Whitfield Street</STREET>
        </ADDRESS>
</COMPANY>

This can be (almost) represented by:

OBJECT TABLE DEFINITION
Field 1 ID
Field 2 Parent
Field 3 Name

ROWS
1 0 COMPANY
2 1 NAME
3 1 ADDRESS
4 3 STREET

Then to retrieve all immediate children of the COMPANY object just do:

        SELECT * FROM tblObject as o1, tblObject as o2
                WHERE o1.ID = o2.Parent
                AND o1.Name = "COMPANY";

My SQL is rusty, so I've probably made a mistake - need JOINs and
whatnot - but you get the picture. (Anyway, the fact that my SQL could
be rusty after so many years of using it shows the advantages of
building a layer on top of the relational database and then just
forgetting about it!)

From this you can see that it takes the same amount of time to find any
node in the tree, no matter how deep. Of course, if you want to keep
drilling down then you would need to keep calling the select statement
above with each child value tested against the parent values. (Get a bit
of performance improvement by using the results of the select in a WHERE
... IN.) Other advantages of this layout are being able to find data in
different parts of the tree, for example, all companies in London.

By the time you've added a few indexes to this structure (and a couple
more tables - it's not quite as simple as outlined here) it is pretty
fast.

Mark

Top of Message | Previous Page | Permalink

Advanced Options


Options

Log In

Log In

Get Password

Get Password


Search Archives

Search Archives


Subscribe or Unsubscribe

Subscribe or Unsubscribe


Archives

February 2018
February 2017
August 2016
June 2016
March 2016
January 2016
July 2014
April 2014
January 2014
July 2013
February 2013
September 2012
August 2012
October 2011
August 2011
June 2011
January 2011
November 2010
October 2010
July 2010
June 2010
March 2010
February 2010
January 2010
November 2009
September 2009
August 2009
July 2009
May 2009
March 2009
December 2008
October 2008
August 2008
May 2008
March 2008
February 2008
January 2008
December 2007
October 2007
August 2007
June 2007
March 2007
January 2007
December 2006
September 2006
July 2006
June 2006
April 2006
February 2006
January 2006
November 2005
September 2005
August 2005
July 2005
June 2005
May 2005
March 2005
January 2005
October 2004
August 2004
July 2004
June 2004
May 2004
March 2004
February 2004
January 2004
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
January 2001
December 2000
November 2000
October 2000
September 2000
August 2000
July 2000
June 2000
May 2000
April 2000
March 2000
February 2000
January 2000
December 1999
November 1999
October 1999
September 1999
August 1999
July 1999
June 1999
May 1999
April 1999
March 1999
February 1999
January 1999
December 1998
November 1998
October 1998
September 1998
August 1998
July 1998
June 1998
May 1998
April 1998
March 1998
February 1998
December 1997
November 1997
October 1997

ATOM RSS1 RSS2



LISTSERV.HEANET.IE

Secured by F-Secure Anti-Virus CataList Email List Search Powered by the LISTSERV Email List Manager