Database Reference
In-Depth Information
avoids the need to create a separate process for each execution of a script, as in the
case of CGI.
Here are the major advantages of server extensions through APIs:
Scripts performing database operations are loaded as part of the server; there-
fore, back-end applications can fully utilize the input and output functions of
the server.
Only one copy of the application script needs to be loaded and shared among
multiple requests to the server from browsers.
Through an authentication layer asking for user ID and password, in addi-
tion to the browser's own security schemes, the web page or website may be
protected.
Passes information out to browsers in additional ways, not possible by unex-
tended servers.
Tracks more information by logging incoming and outgoing activities at the
server.
However, the API approach poses certain difficulties. It is a lot more complex
than the CGI method. Using APIs effectively calls for special programming knowl-
edge and skills. Adding proprietary APIs may introduce potential risks. The normal
functioning of the server is being changed, and that could introduce unknown prob-
lems. The most practical difficulty relates to portability. APIs are completely
proprietary and therefore reduce the portability of the server using such APIs.
Web-Database Integration: CGI vs. API Both CGI and API extend the func-
tionality of the Web server so that back-end database applications may communi-
cate with the browser through the server. Although these approaches tend to
produce similar results, they essentially differ in the way each approach makes the
communication possible and in the efficiency with which they accomplish it. Let us
summarize these two points.
Communication Method CGI establishes communication in a restrictive manner.
A CGI program can communicate with the server according to specifications
through one or more variables. It executes when the Web server interprets a request
from the browser and launches it. After execution, the CGI script returns the results
to the server. That is the way a CGI program can communicate—take information
from the Web server and return information to the server. Only the server can send
the information to the browser.
Contrast this to how communication is carried out in the API approach. An appli-
cation program can intercept information sent by the browser to the server before
the server even reads the information. The program can revise the intercepted infor-
mation and send the information, as revised, back to the browser without the direct
involvement of the browser. Additionally, an API-based program can also perform
operations based on requests from the server just as a CGI script can.
Performance API-based extensions run as part of the server; they are loaded into
the same address space as the Web server. As you know, for each execution of a
Search WWH ::




Custom Search