Client-side and Server-side JavaScript - SSJS VS. CGI
(Page 5 of 6 )
So how do SSJS and the LiveWire database access engine stack up against CGI? SSJS is faster and more efficient for web applications, particularly those that access a database. In internal Netscape tests, SSJS was three times faster than Perl CGIs for database access. There are distinct advantages and disadvantages to each approach, as detailed in the following table.
SSJS | CGI |
Advantages: - Provides state management capabilities.
- Is based on a standardized language (ECMA Script/JavaScript).
- Provides built-in database access via the LiveWire Database Service.
- Includes the Visual Development Tool (VJS).
- Means that client and server programs can be written in JavaScript.
- Allows code reuse between client and server applications.
- Extends functionality using Java (via LiveConnect).
- Caches database connections for faster performance.
- Runs three times faster than CGI.
- Scales better than CGI.
| Advantages: - Is very portable -- can be run on any CGI-enabled web serer.
- Can be programmed in a variety of languages (C, Java, Perl, and so on).
|
Disadvantages: - Requires a JavaScript-enabled web server.
- Requires that the application run in-process with the web server.
| Disadvantages: - Is slow, as a separate process is spawned every time the CGI is executed (which is taxing on the server).
- Makes state management difficult to implement.
- Makes database access available only via separate libraries.
|
Don't overlook the important advantage of using a common development language. If you're using SSJS to create your web applications, you're using JavaScript on both the client and the server. You can concentrate on a single language syntax when you create both the client and the server parts of your application. The syntax is also similar to Java, providing more synergy and code reuse in your development efforts.
Next: SSJS >>
More JavaScript Articles
More By Ibama Supreme Tmunotein