DBMS, May 1997
DBMS Online: Server Side By Martin Rennhackkamp

Basic Web Architectures


You can publish information on the Web in various architectures, ranging from static Web pages to database-driven Web pages.

Static Web Pages

The simplest "presence" on the Web is a static Web page that contains only text and some graphics. The basic informational and graphical content of these pages stays the same until the source code is replaced by the Web master on the Web server. You can include animated Web pages in this category of simple Web pages. Note that "simplest," in the context of this article, refers to a database-oriented point of view and not necessarily to that of an interface designer.

In a static Web page, the Web browser requests an HTML page by submitting a URL to the Web server. The Web server retrieves the required page, either locally or remotely from the Internet. It returns the requested page to the Web browser, which then displays it on the desktop.

In an animated Web page, the Web browser requests an HTML page by submitting a URL to the Web server. The Web server retrieves an applet, either locally or remotely from the Internet by resolving the URL. It returns the requested applet to the Web browser, where the applet is then executed to display its results on the desktop. The dynamic part of the Web browser not only displays the contents of static Web pages, but it also executes the applets and their related controls and dynamic scripts. An applet, typically written in Java, is a mini-application downloaded from the Web server to your client Web browser, where it is then executed. Applets give your Web pages their dynamic behavior. Note that you can intermix dynamic Java applets and static HTML pages in the same application.

In client/server terms, the Web browser is the client component of the architecture. It is the software that runs on your front-end client machine and gives you access to the Web. Examples of Web browsers are Netscape Communications Corp.'s (Mountain View, Calif.) Navigator and Microsoft Corp. (Redmond, Wash.) Internet Explorer. The Web browser displays documents written in HTML, displays images (such as .gif and .jpeg files), and it activates other viewers for other file formats (such as sound and video).

A Web server can be described as a special-purpose file server that serves Web pages to Web browsers. Note, however, that the latest releases of some of the popular Web servers behave more like application servers than simple file servers. These Web servers can also perform various application functions to construct the Web pages. There are many Web servers available, including America OnLine's AOLserver, Netscape's Web server, Oracle's WebServer, and Microsoft's IIS (Internet Information Server).

Form Pages

The next type of page on the simplicity scale is a form page. The user fills in some details in designated fields on the page, as if filling in a form, and then submits the form in a batch-like operation to the Web server. If the submitted form fails any validation checks that the system may perform, you receive an error message page telling you what is missing and instructing you to use the back button to return to the form. The user must then correct or complete the form and resubmit it.

Form pages are usually developed using basic HTML code and CGI scripts. The Web browser requests a form page as described above. The Web server retrieves the form, just as it would a normal HTML page, and then returns the requested form to the Web browser, where the form is then displayed. After the user has filled in and submitted the form, it is returned to the Web server, where a CGI script is executed. This CGI script takes the values entered onto the form and uses them as defined in the script. A typical CGI script would insert the entered values from the form into a file, or it would compose an email message containing the entered values and send it off. CGI is a mechanism for invoking a script on the Web server from the Web browser. A server-side CGI executable can be any compiled program, such as C or C++, supported by the Web server's operating system. Many Web servers also support a Windows CGI that lets you develop CGI executables in Microsoft Visual Basic. However, it is important to note that any CGI call requires a separate process, with its own overheads and CPU utilization.

Database Query Pages

The simplest form of database-driven Web pages are simple query pages in which you fill in some parameters on a form, submit the form, and the requested data returns as a Web page to your Web browser. In a Web-based database information-retrieval application, the Web client requests data from the Web server; this request is usually in the form of a SQL query requested from a CGI script which is executed on the Web server. The Web server requests the data from the DBMS server, which in turn retrieves it from the database. The database server packages the output data in a form understandable by the Web browser, such as HTML code to display the results in a table field, and it returns the formatted data as a predesignated Web page to your Web browser via the Web server. Your Web browser then displays the results as a Web page called from the Web page that first activated the query (See Figure 1). This is called a three-tier architecture, because the Web browser requests a service from the Web server, and the Web server in turn requests a service from the DBMS server, which retrieves the data from the database. Note, however, that the CGI script is spawned on the Web server for every database access request from the Web browser. Each time, the spawned CGI script connects to the database and requests the DBMS server to perform a SQL query. On a Web server with hundreds of users, this repeated spawning of processes and repeated connections to the database can consume many resources.

An INSERT, UPDATE, or DELETE operation is processed similarly. The SQL operation is requested from a CGI script executed on the Web server, as requested from the Web page. The Web server then requests the DBMS server to perform the operation on the database. The DBMS server notifies the Web server, which in turn notifies the Web browser of the successful completion of the operation. The data filled in on a form page can be inserted into a database table in this way.

The newer Web servers all provide direct links to the more popular DBMS servers. Most of them use one of the following core technologies:

It is important to consider the impact of Java on Web-to-database applications. Java is the one mechanism through which developers can bring dynamic application behavior to the Web. The Web browser downloads Java applets from the local or remote Web servers for execution on the Web browser. The applets run disconnected from the Web server, like native client applications. Although Java itself cannot connect to outside resources, such as local or remote database servers, the JDBC API solves this problem. JDBC can database-enable any Java applet, and the Java applet can bring the required dynamic behavior to the Web application. Note that some JDBC implementations use an underlying ODBC architecture. In such a scenario, the JDBC requests are translated to ODBC requests, which in turn are requested from the DBMS server.

Web architectures are evolving fast. They are moving away from static and static-dynamic pages to full-dynamic and interactive Web pages. The goal for Web-based database applications is interactive database-driven pages that allow interactive, data field-oriented queries and updates to the database, without requiring the submission of an entire Web page as a form. For example, in addition to the queries and updates I've already described, the data you enter in a field should be validated against the database immediately when you leave the field. As another example, the set of valid input values for a field should be presented as a pull-down list, that is filled from the database when you select the pull-down list. It is essential for organizations to develop field-oriented interactive database applications if they want to develop and deploy these applications on the Internet or even on an Intranet. End users have become accustomed to the field-oriented interactive applications of the Windows world -- they see the move to the batch-like, forms-oriented Web pages as a step backwards.


Martin Rennhackkamp is the owner and principal consultant of The Data Base Approach, a corporation specializing in relational and distributed databases, based in Cape Town, South Africa. You can reach Martin via the Internet at mr@dba.co.za.


Figure 1


-- The path of a database-driven Web page.

Figure 2


-- Java-based Web-to-database access.

Return to Server Side : Desegrating DBMSs

Subscribe to DBMS and Internet Systems -- It's free for qualified readers in the United States
May 1997 Table of Contents | Other Contents | Article Index | Search | Site Index | Home

DBMS and Internet Systems (http://www.dbmsmag.com)
Copyright © 1997 Miller Freeman, Inc. ALL RIGHTS RESERVED
Redistribution without permission is prohibited.
Please send questions or comments to dbms@mfi.com
Updated Monday, April 14, 1997