Use DB2 native XML with PHP, Database Articles, Global Guide Line Technology is a Mega IT Portal.
Google
Join Global Guide Line community

     Home                    

   First Website Guide       

   Learn HTML                 

   Learn CSS                    

 

   Learn XML                    

   Learn XSLT                  

   Learn Java Script          

   Learn SEO                   

   Learn SQL                   

   Database Articles         

   Web Hosting Guide      

   Services                       

   Contacts                       

Use DB2 native XML with PHP


     Back             Next     

Leverage DB2 native XML functionality and PHP to simplify apps using XML data

27 Mar 2007

Learn about the effectiveness of using the native XML capabilities coming in the next version of DB2® Universal Database™ for Linux®, UNIX®, and Windows® to simplify application code and the relational schemas. This article looks at the impact of schema evolution on the application and walks the reader through a usage scenario to illustrate the ease of setting up a PHP environment; the ease of integrating DB2 native XML functionality with PHP applications, including Web services written in PHP and XQuery; and the benefit of pushing the business logic and data transformations into the database, using XQuery, stored procedures, and views.

To highlight the impact of using DB2 native XML support on PHP application code and relational schema design, the scenario creates a parallel environment using a database that does not have any XML capabilities (for example, MySQL). We show the difference in the application code, database queries, and the relational schemas for the two environments.

Introduction

PHP enables a simple Web application development and deployment environment. This is one of the reasons for its popularity. DB2's native XML capabilities, coming in the next version and referred to as the DB2 Viper release, further simplify the development process. This simplification appears in the form of:

  • Smaller application code size and reduced complexity
  • Simpler relational schema
  • Better management of schema evolution due to changing business requirements

To understand the foundation of DB2's native XML support, we recommend that you start by reading a DB2 Magazine article, Firing Up the Hybrid Engine by Anjul Bhambhri, DB2 development manager for native XML support.

In this article, we build on that foundation and demonstrate the effectiveness of using DB2's native XML capabilities to simplify the application code and the relational schemas. We will also look into the effects of changes in the business requirements on the data (schema evolution) and its impact on the application code and the relational schema.

To illustrate our reasoning we will follow a usage scenario modeled around an online shop selling antique silverware to registered customers.

Some of the points we will show in the course of the scenario are:

  • The ease of setting up a PHP environment
  • The ease of integrating DB2 native XML functionality with PHP applications, including Web services written in PHP and XQuery
  • Pushing the business logic and data transformations into the database, using XQuery, stored procedures, and views.

The DB2 XML features we will be using in the scenario will cover the following areas:

  • XML document storage in a column as a parsed structure
  • Using XQuery to search and publish
  • Support for XML in DB2 stored procedures and views
  • Use of XML indexes to boost performance

To highlight the impact of using DB2 native XML support on PHP application code and relational schema design, the scenario will create a parallel environment using a database that does not have any XML capabilities (for example MySQL). We will explore the difference in the application code, database queries and the relational schemas for the two environments. We will explain our justification for choosing a particular code, schema, or query, and the alternatives if possible.

     Back             Next     



[ About ] [ Contact ] [ Home ]
[ Links ] [ Site Map ] [ Services ] [ Privacy ]

Copyright © 2005-2006 www.globalguideline.com All rights reserved. Join Global Guide Line community.