I. Common Gateway Interface (CGI) Solution
The CGI solution is the most widely used of the three architectural approaches. CGI itself is a protocol by which HTTP servers invoke external applications in response to a user requesting a URL. The external applications would respond to the request by dynamically building the Web page. In order to fulfill the request, this application may access a relational database or other data store.
A CGI application is a collection of functions which respond to specific user requests. Each of these functions is executed as a discrete process on the machine where the HTTP server is located. Therefore, each function is a separate executable, usually written using a language such as C or a scripting language such as PERL. The Web server for the this approach could be any server supporting the CGI protocol. Figure 1 illustrates how the components of a CGI application interact.
Figure 1 CGI Approach
Simple and Proven Methods. The Common Gateway Interface approach uses HTML, CGI, and C or PERL, all of which are proven technologies. The CGI solution is fairly simple to develop. It is stable, not reliant on new and/or emerging standards, and does not require an extremely sophisticated body of knowledge to maintain.
Any Browser or HTTP Server May Be Used. Assuming no browser-specific HTML is employed, any web browser capable of interpreting standard HTML may be used to access the application. The appearance of the application may differ slightly from browser to browser, and some modifications may be necessary to ensure a satisfactory appearance on the popular browsers. In addition, no specific server reliance exists, thus allowing existing hardware to be leveraged.
Difficult to Change Web Page Design. Since the HTML code that determines the Web page appearance is embedded in C applications, modifying the layout of the Web pages requires knowledge of the C language. Additionally, making changes will require the application to be recompiled and redeployed. This also means that Web page design packages cannot be used to produce the final HTML. Design programs can be used in the early stages to design the basic appearance of the page, but the HTML code that is produced has to then be incorporated into the C applications. After that, any changes to the pages need to be done by hand, without the help of a Web page designer.
Poor Scalability. CGI-based solutions require a discrete process to respond to each user request. This not only leads to inefficient use of available server resources, but also means applications with high transaction volume requirements will not provide satisfactory response times.
Session Management. A session exists if there is a virtual circuit between the client and the server, which is established at the client log-on and destroyed at client log-off. Typically, there would also exist session context information which would contain a connection to the database. CGI does not support this paradigm, hence the identity of the user making the request is not available between requests. Work-around solutions to this problem require more development effort and maintenance time than would be required with more technologically complex solutions.