Designing XML Application

1 view
Skip to first unread message

Everson Alves

unread,
Jan 5, 2008, 7:44:36 AM1/5/08
to XML Schema
Hello,

I'm in the process of designing a relatively large XML DB System and
I'm having some doubts regarding the best structure for the main XML
document, in order to optimize search as well as organizing the
document in such a way that is not relational (as I usually tend to
think when designing an XML DB, for background reasons).

Basically, we're trying to create a single XML document, but there's a
lot of information spread in other entities and tables. We´re trying
to minimize the tables and aggregate as much information as possible
in a single XML file, to avoid any "relational" query, but also
without getting redundant. To illustrate what I mean, here is an
example:

<?xml version="1.0" encoding="UTF-8"?>
<doc>
<people>
<person>
<name> Johnny </name>
<address> St. Street, 444 </address>
</person>
<person>
<name> Tom </name>
<address> Mr. Street, 444 </address>
</person>
<person>
<name> Cat </name>
<address> Dr. Street, 444 </address>
</person>
</people>
<vehicle>
<driver>
<!-- redundant information, like above -->
<person>
<name> Johnny </name>
<address> St. Street, 444 </address>
</person>
</driver>
</vehicle>
</doc>


As you can see above, we have some redundant information repeated.
Also, most importantly, I have no way of having some referencial
integrity. Now, in the next example, I have tried adding a reference,
using an ID node in the person element, in order to avoid the
redundancy and get some integrity:


<?xml version="1.0" encoding="UTF-8"?>
<doc>
<people>
<person id="10">
<name> Johnny </name>
<address> St. Street, 444 </address>
</person>
<person id="11">
<name> Tom </name>
<address> Mr. Street, 444 </address>
</person>
<person id="12">
<name> Cat </name>
<address> Dr. Street, 444 </address>
</person>
</people>
<vehicle>
<driver>
<!-- storing just an ID reference> -->
<person>
<id>10</id>
</person>
</driver>
</vehicle>
</doc>


But that's my point: am I thinking "relational" here? Is there any
other way to solve this, in a more efficient and secure way?

best regards
Reply all
Reply to author
Forward
0 new messages