© 1998, Web Techniques. All rights reserved. Reprinted by permission.


The promise of object-relational technology is being able to store all content, including Web pages, in a single container known as a universal database.

Dynamic Servers and Web Pages in a Database
by Ken North

This is the Database Developer column from Web Techniques, December 1998.

During a recent Dr.Dobb’s Technetcast interview, Dale Dougherty described the traditional approach to automating and managing information. In one container, which we call a database, we put structured data such as rows and columns of numbers. In separate containers, we put multimedia, complex data, and documents such as HTML pages. The traditional method of organizing Web pages has been to store them as individual files managed by the operating system. In order to present a Web page that has database content, we go to the database container to extract information to integrate with HTML stored in a different container. This model requires a chain of software which has links that can include a DBMS, middleware such as ODBC or JDBC drivers, and a Java servlet or application built with CGI, Netscape Application Programming Interface (NSAPI), or Internet Server API (ISAPI). The picture changes when we use object-relational technology and universal database servers. The promise of object-relational technology is being able to store all content, including Web pages, in a single container known as a universal database. A universal database can store all types of content, including HTML documents, images, audio, video, and other rich data types. A server such as Informix Dynamic Server, Universal Data Option (DS/UD) can store the entire contents of a Web site.

DS/UD is Informix’s extensible server for object-relational databases. DS/UD runs on Windows NT Server and a variety of UNIX systems. It offers a scalable architecture that supports parallel operations, some SQL3 features, and database extensions known as DataBlades. In addition to the Universal Data Option, Informix offers the Web Integration Option (WIO) for Web applications, and the Decision Support Option for applications such as Online Analytical Processing (OLAP), data marts, and data warehouses. Informix designed Dynamic Server as a high-performance architecture. It supports partitioned tables, parallel sort, parallel join, parallel scan, parallel insert, parallel aggregation, and a 64-bit, large memory addressing model. Dynamic Server uses shared memory, multithreading, and a server architecture that comprises virtual processors. The virtual processors run as threads or operating system processes that communicate via shared memory. They include a CPU Virtual Processor, Network Virtual Processor, Extension Virtual Processor, and Asynchronous I/O Virtual Processor. The Extension Virtual Processor is used for DataBlade processing.

Besides DataBlades, there are other solutions for programming DS/UD and storing logic in a database. Dynamic Server supports triggers, cascading deletes, and stored procedures written in Stored Procedure Language (SPL). The INFORMIX-Developer SDK includes a Java API, an ODBC/SQL-92-compatible Call Level Interface (CLI), and embedded SQL (ESQL). You can also write JDBC clients for Dynamic Server by getting a JDBC driver from WebLogic, OpenLink, Intersolv, or Simba Technologies (see "Online" for their URLs).

When using the WIO, you can serve up Web pages directly from an Informix database instead of maintaining separate HTML files. The WIO software recognizes special tags used to generate Web pages dynamically. This approach is particularly well-suited to Web sites having frequent changes of content. Cyber-publishing sites, such as the Associated Press (AP) WIRE site, use Informix’s Web integration technology to keep up with a high volume of daily updates. The WIRE site serves up about 4 million pages per month from a database containing 1700 photos and 1700 stories, and adds 1000 images and stories per day. Other cyber-publishing sites built with Informix servers include www.chinabyte.com, www.bender.com, www.realfans.com, and www.mondadori.com.

 

DataBlades

A major benefit of using the DS/UD is the ability to store diverse content in a database. The DS/UD architecture lets you use DataBlades, plug-ins that extend the server’s capabilities. DataBlades extend the Dynamic Server core DBMS by adding capabilities such as text processing, image processing, event handling, spatial data processing, and fingerprint matching.

When you install DataBlades, you extend a database with objects that provide new types, casts, operators, and routines to support those types. These user-defined objects appear in the system catalog so you can view them with DS/UD’s Schema Knowledge program. Figure 1 shows a Schema Knowledge view of a DS/UD database called stores7 after installation of the Web Integration Option. WIO-enabled databases store information about Web projects, including resources and dynamic tags. They also contain tables created by the WIO schema to keep track of Web-page information. The upper panel of Figure 1 is an Inheritance View of these tables. The lower panel is an Objects View of a database that shows its Access Methods, Aggregates, Casts, Operators, Routines, Tables, and Types. The Objects View also shows HTML and other types installed in the WIO-enabled stores7 database.

DataBlade modules contain a dynamically loaded library of shared objects, with SQL that describes the objects. Right out of the box, DataBlades provide b-tree and r-tree indexing, but the architecture supports custom access methods and indexing schemes. Dynamic Server is programmable with SPL, ESQL and CLI, but DataBlades expose additional APIs. The DataBlade Developer SDK provides a C++ Interface and a Java API.

 

What Do DataBlades Add?

DataBlades add capabilities that supplement what we typically expect to come "in the box" when we install a DBMS. As of September 1998, there were ten digital media (audio, video, images), four text, five geospatial, and four data-warehousing DataBlades. There are also e-commerce, financial, bioinformatics, and healthcare DataBlades. You can find a list of DataBlades at my Website (see "Online").

One of the more important DataBlade benefits is that they expose their capabilities through standard SQL queries. This means that developers can integrate events and transactional, publish, and subscribe messaging into SQL applications, for example. The TIBCO TIB/Connect for Web DataBlade lets you tie events to business rules and store messages in databases, including messages with audio and video data. It lets you send messages in response to events such as low stock conditions, hazard warnings, customer service callbacks, stock price changes, changes in buying patterns, or new research findings. Sites such as NASA’s Goddard Space Flight Center are using custom DataBlades to support geospatial applications. ECOlogic has developed a DataBlade that supports HDF, a hierarchical data format for science data. By using the HDF-EOS DataBlade, a user can write SQL queries to investigate the correlation between physical parameters, such as cloud density and precipitation, for a specific geographical region.

 

Types

At times, our creative instincts call out for us to create more compelling applications and Web pages. To respond, we may need a different approach to storing and presenting information. In database terms, this means we often need custom data types to supplement built-in types such as numbers and characters. Dynamic Server’s extensible architecture means developers are in "type heaven," because they have access to native, built-in types, extended types, and complex types derived from extended or built-in types. The native Dynamic Server types include characters, numerics, large object types, time data, and logical types. In addition, DS/UD lets you create complex types, distinct types, and opaque types. A distinct type is an aliased type whose representation is identical to another type. Opaque types are fully encapsulated types that store single values. They can’t be interpreted or divided into components. DS/UD also provides collection types including sets, multisets, and lists. You can also use named and unnamed row types. Developers sometimes use row and collection types to denormalize data when performance is an issue.

 

Web Integration Option

The Web Integration Option includes functions, variables, SGML-compliant tags, and Web driver software for communicating with Web servers. WIO provides persistent state information about sessions and connections. It recognizes the tags in Table 1, and provides user- and system-defined shared dynamic tags. The system-defined tags let you add objects such as radio buttons, list boxes, and select lists to your Web page. Dynamic Server stores dynamic tags in the webTags table of a WIO-enabled database. Adding the WIO to a database installs functions you can use in SQL statements. These include WebExplode, WebRelease, WebLint, WebUnHTML, WebURLDecode, and WebURLEnDecode. If you use WebExplode in a SQL statement, it executes the query, expands all DataBlade tags, and returns a "filled-in" AppPage. (We’ll get to AppPages in a moment.) The following SQL query contains a WebExplode function that generates a Web page with a list of students:

SELECT WebExplode (stu_form, '') from web_apps whereapp_id = 'student_list';

WIO includes a Webdriver program to provide a CGI, NSAPI, or ISAPI interface to Web servers, and a SQL interface to the database. Webdriver lets you focus on creating Web pages and SQL queries without having to write supporting code in C, Perl, or another programming language. It caches large objects, passes image map coordinates, processes errors for WebExplode, and so on. Webdriver lets you include HTTP headers in AppPages to use cookies and retrieve non-HTML pages. WIO automatically converts cookies into DataBlade module variables.

 

Table 1: Tags Processed by Informix Web Integration Option Functions

Tag Purpose
MIBLOCK Delimit blocks of HTML for conditional evaluation
MIERROR Specify error-handling logic
MISQL Execute SQL and format page with results
MIVAR Variable assignment and display

 

Data Director for Web

To create and use databases that are sufficiently rich to store Web sites, we need authoring tools that can exploit object-relational database capabilities. Informix Data Director for Web (DDW) can be used alone, or in combination with other authoring programs, to create forms-driven, database-enabled pages known as AppPages. DDW uses WIO tags and stores the Web page content in an Informix database, although you can still export Web pages to the file system. DDW provides an option to import file system-based Web sites, which converts links to files into Webdriver-compatible links. DDW AppPages are HTML pages containing embedded SQL queries and resources such as binary objects and dynamic tags. DDW Web sites contain templates with dynamic tags, HTML, text, audio, video, spatial data, and other types. Before using DDW to author a Web site, you must install a predefined schema in the database that will contain the site.

DDW includes two graphical tools known as Site Manager and AppPage Editor. Site Manager works with site content in the database or external files. With Site Manager, you can create and view projects and manage extensible resources such as used-defined tags and MIME multimedia types. DDW provides default MIME mappings for commonplace resources, and Site Manager lets you create mappings for unknown file extensions. DDW can launch resource editors based on MIME type.

Site Manager presents a Project View or File View of a Web site’s contents stored in Informix databases. The left frame is tabbed, so you click on different tabs to select how the data is presented. The Project View shows content organized by project, whereas the File view is file-centric. Databases can store multiple projects and share resources across sites. Figure 2 illustrates a Project view, or tree view of a project contained in the stores7 database. The database can contain HTML pages, as shown in the right panel, or other resources such as audio, text, video, and image data. Site Manager installs the DDW schema in databases and provides locking and versioning.

AppPage Editor is DDW’s tool for editing pages and user-defined tags. You use it to specify the logic of variable processing functions for AppPages or dynamic tags. AppPage Editor provides Input, Query, Delete, and Update wizards to guide you through the process of creating forms—such as Input, Query, Delete, and Update —for commonplace database operations.

The Query Wizard helps build the MISQL tag used for SQL queries against the database. The Input Wizard and Update Wizard help build data entry forms that support data validation when inserting data into or updating the database. Both wizards generate one tag for the form presentation, and a second tag for input validation and database update. Site Manager provides drag-and-drop editing as a way to import images and other Web page resources from the file system. This means, for example, that you can click on a file icon in Windows Explorer and drag it into Site Manager. DDW can be integrated with site-building tools such as HAHTsite, Visual InterDev, and Microsoft FrontPage, and it exposes a C++ API based on Microsoft Foundation Classes (MFC).

 

Web-Enabled Databases?

The pace of technology means we’re rapidly updating our vocabulary. Previously I’ve described Java-enabled databases as databases containing Java classes. I suppose we need to use a term such as "Web-enabled database" to refer to a database, such as Informix DS/UD, that stores all Web-site contents. The majority of Web developers still use the file system to manage site content, but that may change as we see the benefits of data mining and data interchange for e-commerce. Data Director for Web is a pioneering product because of its ability to author Web sites in a database. There are likely to be others as more developers start using databases to encapsulate complete sites.

 

About the Author

Ken North develops software, consults, and teaches Expert Series seminars. He is the author of Database Magic with Ken North (Prentice Hall PTR) and Windows Multi-DBMS Programming (Wiley).

 

Figure 1: A Web-enabled Informix DS/UD database. The upper panel is an Inheritance View of tables used by the WIO to manage Web pages. The lower panel shows an Objects View of HTML and other types installed in a Web-enabled database.

Figure 2: DDW’s Site Manager presents different views of a Web site’s contents stored in Informix databases. The database can contain HTML pages, as shown in the right panel, or other resources such as audio, text, video, and image data.

Online

Associated Press WIRE site wire.ap.org
DataBlade Information ourworld.compuserve.com/homepages/Ken_North/blades
ECOlogic HDF-EOS DataBlade www.ecologic.net/HdfEos/HDF-EOS.html
Goddard Space Flight Center ww.gsfc.nasa.gov/GSFC_homepage.html
Informix www.informix.com
Intersolv / Micro Focus www.intersolv.com
OpenLink Software www.openlinksw.com
Simba Technologies www.simba.com
TIBCO TIB/Connect for Web www.tibco.com/products/tibconnectweb.htm
WebLogic www.weblogic.com

Ken North Home Page
Copyright © 1998 Web Techniques. All rights reserved.
Revised: July 18, 2003.