open.itworld.com
  Search  
Security Home Page Security Webcasts Security White Papers Security Newsletters Security News Open Topics Careers ITworld Voices ITwhirled The Security site of ITworld.com
XML Databases
LINUX TIPS AND TRICKS --- 09/27/2002

Danny Kalev

A relational database stores information in tables, with the ability to relate information from one table to information in another table. The primary data unit in relational databases is a column, which may contain one or more fields. While this model operates well under traditional data oriented systems, it isn't ideal for manipulating XML data. Database vendors have come up with several solutions to this problem. I will discuss two representative products that are available on Linux. 

On this topic

Data-centric and Document Centric XML
Document-centric XML documents typically contain essays, poems, letters etc. In these documents, the primary data unit is the entire document, rather than individual fields. By contrast, data-centric documents can be an employee's information or a catalog item. Human beings are not intended to read such documents in their raw form, but rather they are created and used by software application. In such documents, individual nodes contain meaningful information even when used outside the context of their document, an employee's name for example.

XML-enabled Databases
Relational databases that offer special capabilities for dealing with XML data are known as "XML-enabled databases". They map XML data to traditional rows and columns internally. The simplest mapping model simply stores the original XML document in a table column as a Large OBject, or LOB. This mapping model isn't ideal for performing sophisticated queries based on specific elements of an XML document since the database engine isn't aware of its structure. IBM's DB2 uses "side tables" to solve this problem. A side table contains additional indexes that point to specific elements in the original XML document.

Alternatively, a side table contains the navigation scheme of the original document (known as "XPath" in XML-parlance). However, neither of these methods is truly relational. If we wish to change a single node, we need to retrieve the entire document value, change it, and write it back. This approach is therefore more suitable for document-centric applications.

Object-relational Storage
A second mapping model breaks the elements of an XML document into individual table rows, or fields. This way, the database is aware of the original document's structure. Oracle's 9i database implements this approach. The DBA can decide which documents should be mapped to a table schema and which documents should be stored as LOBs. Equipped with an array of XML-related software tools such as XML Class Generator, XML SQL Utility and XML Parser, Oracle's 9i handles document-centric and data-centric XML equally well.

Signing off
As you may have heard, this is the last issue of the Linux Tips and Tricks newsletter. I would like to take this opportunity and thank all of you for supporting this newsletter during the past 3 years by sending your valuable comments and suggesting topics. I hope that you've enjoyed reading this newsletter as much as I've enjoyed writing it.

 

Danny Kalev is a system analyst and software engineer with more than 10 years of experience, specializing in C++ and object-oriented analysis and design on various platforms including VMS, DOS, Windows, Unix, and Linux. His technical interests involve code optimization, networking, and distributed computing. He is also a member of the ANSI C++ standardization committee and the author of ANSI/ISO C++ Professional Programmer's Handbook (Que, 1999). Danny can be reached at Danny.Kalev@itworld.com.



Advertisements
Sponsored links
KODAK i1400 Series Scanners stand up to the challenge
Locate Hidden Software on business PCs with this free tool
Bring harmony to your mix of UNIX-Linux-Windows computing environments
Top 5 Reasons to Combine App Performance and Security
 Home   Newsletters  LINUX TIPS AND TRICKS
www.itworld.com    open.itworld.com     security.itworld.com     smallbusiness.itworld.com
storage.itworld.com     utilitycomputing.itworld.com     wireless.itworld.com

 
Contact Us   About Us   Privacy Policy    Terms of Service   Reprints  

CIO   Computerworld   CSO   GamePro   Games.net   IDG Connect   IDG World Expo   Infoworld   ITworld   JavaWorld   LinuxWorld  MacUser   Macworld   Network World   PC World   Playlist  

Copyright © Computerworld, Inc. All rights reserved

Reproduction in whole or in part in any form or medium without express written permission of Computerworld Inc. is prohibited. Computerworld and Computerworld.com and the respective logos are trademarks of International Data Group Inc.