Two illustrative approaches to support the persistency of eXtensible Markup Language (XML) data include the relational database management system (RDBMS) and the native XML database (NXD).
A relationship database that most people are familiar with includes tables with fields and rows. Examples include Oracle, Sybase, IBM DB2, Microsoft SqlServer and Informix. A RDBMS stores data in tables that are organized in columns. The XML documents can be converted in an relational database and queried with tools like SQL. In a RDBMS the persistence framework contains the logic for mapping application classes to the database or other persistent storage sources. In refactoring the database, the meta data may need to be updated which describes the mappings. The approach to storing XML data in a RDBMS includes flat storage and shredded storage. Flat storage takes an XML document in a cell whereas shredded storage normalizes in into millions of parts.
While RDBMSs are the most commonly used type of persistence mechanism, there are also other options including native XML databases. NXD examples include dbXML, OpenLink Software’s Viruoso, Sofrware AG’s Tamino and X-Hive/BD. NXDs have XML nodes and documents. A native XML database is based on “containers” that are designed to work with XML data. Generally speaking, NXDs are not intended to replace existing databases but provide a tool for storage and operations on XML documents. In terms of storage, NXDs are good a storing XHTML or DockBook type data where the data is less rigid. NXDs usually store a modified form of the entire XML document in the file system in a compressed or pre-parsed binary form. It is also a possibility to map the structures accede.
The following summaries the general pros and cons of each mechanism:
- Mature technology
- Dominate the persistence mechanism market
- Several well-established vendors
- Standards, such as Structured Query Language (SQL) and JDBC well defined and accepted
- Significant experience base of developers
- Object-relational impedance mismatch can be a significant challenge
- Mapping objects to relational databases takes time to learn
- Native support for persisting XML data structures
- For XML intensive applications it removes the need for marshalling between XML structures and the database structure
- Emerging technology
- Standards (the XML equivalent of SQL, not yet in place for XML data access)
- Not well suited for transactional systems
There is no one right answer on how to approach XML persistence. While there are many new tools in the marketplace, having a consistent and well documented approach is important. The next decade will illustrate whether or not XML can live up to the hype of promises for data storage.
#Persistence #XML #RDBMS #NXD