[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: XML Schema for large database


xml schema to database table
Title: RE: XML Schema for large database

Bill,

One thing to keep in mind is the structure of the schema (and therefore the corresponding XML documents), as this may affect locking when committing information to a database (and the more information you have, the longer the duration of the locks).  That is, suppose you have an Order table and an Item table - there are 2 basic ways to structure this information:

(1) "Nested" approach
(2) "Blocks" approach

In (1), the XML document would look as follows (as you can see, the Item records are "nested" inside their corresponding Order records):

  <Orders>
       <Order orderID="123">     
          ...order information here...
        <Items>
              <Item itemID="0116602800">
                      ...item information here...
               </Item>
                <Item itemID="0116659813">
                      ...item information here...
               </Item>
              ...more items...
           </Items>
       </Order>     
  ...more orders...
</Orders>  

It seems reasonable to assume that when committing this information to a database, one may have to lock multiple tables simultaneously (thereby violating the best practice rule of "hold locks for as little time as possible").  That is, the Order table would need to be locked, then the Item table (while the Order table is locked), etc.  The more tables that are involved, the more simultaneous locks that need to be held.  There are certainly creative ways around this, but these would involve an intermediate step that places the information in a more "lock-friendly" structure.

In (1), the information is in "blocks" that correspond to database tables.  For example:

  <Orders>
       <Order orderID="123">     
          ...order information here...
       </Order>  
        ...more orders...
  </Orders>
  <Items>
        <Item itemID="0116602800" orderID="123">
           ...item information here...
        </Item>
        <Item itemID="1106500706" orderID="456">
           ...item information here...
        </Item>
        ...more orders...
  </Items>

With this approach, only the Order table needs to be locked when committing Orders to the database, then only the Item table, etc.  The only caveat is that there needs to be a cross-reference from Items to Orders, so that it is clear which items belong to what orders (see orderID attribute above).

Hope this helps,
Joe Chiusano
LMI

> **************************************************************************
>   Joseph M. Chiusano
>   Logistics Management Institute
>   2000 Corporate Ridge
>   McLean, VA 22102
>   Email: jchiusano@l...
>   Tel: 571.633.7722
> **************************************************************************
>


-----Original Message-----
From: Bill Riegel [mailto:BRiegel@l...]
Sent: Thursday, August 15, 2002 10:17 AM
To: 'xml-dev@l...'
Subject: XML Schema for large database


Wanting to serial the contents of portions of a large database, i.e. 500 -
1000 tables definitions.
The purpose of the file to allow it to be loaded by someone else, somewhere
else.

Trying to understand the implications of creating a XML Schema that reflects
the rules
of the entire database. The XML Schema will be 1000's if not 10000's line
long.

I would auto create the XML Schema from the database's metadata.

But would there be problems with parsers or transformation engines being
able
to consume it.

I have been toying with the idea of breaking up the logical model into
several
smaller sets, and only allowing the user selection a set of tables that are
defined in the set.

Or have the minimal about of data in one xml file. and collect the files in
a
zip file. Each file would then have a small(er) Schema.

Is it possible/probable that a large schema would not be able to be
processed ??

Bill Riegel
Landmark Graphics
Phone: 713-839-3388

-----------------------------------------------------------------
The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
initiative of OASIS <http://www.oasis-open.org>

The list archives are at http://lists.xml.org/archives/xml-dev/

To subscribe or unsubscribe from this list use the subscription
manager: <http://lists.xml.org/ob/adm.pl>


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.