Web-Powered Databases: The Low Level in C++

Web-powered databases (WPDB) refer both to databases accessible through the Web and to their underlying architecture. This chapter concerns this architecture. It presents the low-level implementation of a WPDB mock-up. The claim which supports the chapter is that this low level analysis can facilitate the understanding of the fundamental mechanisms embedded in a WPDB. All the components of the mock-up, except the Web server itself, are coded in C++. This will illustrate how the techniques such as Internet connections, multitasking, multithreading, and named pipes can be used to develop a WPDB architecture. Moreover, beyond its explanatory aim, the present chapter offers a very practical issue as the C++ codes can be used as a guideline or even more reused as is for the development of more complex WPDBs. INTRODUCTION Web-powered databases (WPDB) are databases accessible through the Web. Today, they are becoming a popular tool to deal with the increasing interest in the availability of information, for at least two reasons: on one side, their architecture is simple due to the universality of Web servers and the underlying HTTP protocol (HyperText Transfer Protocol); and, on the other side, the new semi-structured approach to data models is well adapted to the diversity of data on the Web, as pointed out by Abiteboul, Buneman, and Suciu (2000). But, of course, any type of database can be Web-powered, relational, object or simply file. This chapter is concerned with the first reason, and hence, is architecture-oriented. 701 E. Chocolate Avenue, Hershey PA 17033-1240, USA Tel: 717/533-8845; Fax 717/533-8661; URL-http://www.idea-group.com ITB8246 IDEA GROUP PUBLISHING This chapter appears in the book, Web-Powered Databases, edited by David Taniar. Copyright © 2003, Idea Group Inc. Web-Powered Databases 177 Copyright Idea Grou p Inc. Copy right Idea Grou p Inc. Copy right Idea Grou p Inc. Copy right Idea Grou p Inc. A WPDB is a subtle device with several protagonists which interact and communicate. There are a lot of free or commercial high-level tools to set it up, such as navigators (or browsers), database systems and specialized scripting languages. They are designed to simplify the programming tasks by hiding the fundamental mechanisms. They do not, however, always simplify the understanding of the entire device and how the protagonists interact. This chapter aims at facilitating this. We believe a good manner is to present simultaneously the essential mechanisms and their implementation at a low level since, in general, the low-level, although less easy, enlightens the higher levels. To the purpose, this chapter presents a WPDB mock-up, written in C++1, running under Windows NT (WinNT) and using the Win32 Application Programming Interface (API) functions. Moreover, the Apache server (downloadable from www.apache.org) will be the Web server of the mock-up. The mock-up is only a skeleton. All its components such as its navigator, its database manager, its database and its application are reduced to the minimum in order to concentrate on the underlying mechanisms and on how techniques such as Internet connections, multitasking, multithreading, synchronization, and named pipes are used. However, for more elaborate applications, the skeleton can be extended in order to cover their needs. Web-Powered Databases The word “Web” distinguishes Web-powered databases among what could be called analogically network-powered databases, i.e., databases which can be accessed by several remote clients. From an architecture point of view, WPDB’s are original because they use a so-called Web server to carry out the communications with the outside. The main feature of Web servers is that they are universal: they do not depend, contrary to usual middlewares, on applications. Instead, they are very general devices useful any time someone wants to make internal resources of a computer available from the outside. Web servers receive external requests to the resources and send them back to the external clients. When the resource is inert, e.g. a HTML file, it is sent as it is, but when it is active, e.g., a program, the server spawns it and the new process sends its outputs to the client. Web servers are based on the so-called HTTP protocol which defines the format of the requests and of the answers. The protocol is both simple and has a high level of universality. Web servers inherit these same qualities2. Consequently, they can be coupled with any process on the server machine, particularly with a database server. The coupling of a Web server and a database server is the basis of the WPDB architecture. It is also regarded as a 3-tiered architecture provided that the external clients are considered as the third tier. The architecture of the mock-up presented here will comply with this scheme. Moreover, like any client-server database device, it will have to satisfy the following sine qua non run-tim [one-to-one] and [welcoming] invariant properties: • [one-to-one] connections between external clients and the database must be one to-one in a way that answers to one client will not be sent to another; and 25 more pages are available in the full version of this document, which may be purchased using the "Add to Cart" button on the product's webpage: www.igi-global.com/chapter/web-powereddatabases/31428?camid=4v1 This title is available in InfoSci-Books, InfoSci-Database Technologies, Library Science, Information Studies, and Education, InfoSci-Library and Information Science, InfoSciComputer Science and Information Technology, Science, Engineering, and Information Technology, InfoSci-Select, InfoSci-Select. Recommend this product to your librarian: www.igi-global.com/e-resources/libraryrecommendation/?id=1