[ Previous ] [ Contents ] [ Index ] [ Next ]

External Database Drivers

Prior to Version 2.1, AOLserver provided a tightly-coupled solution to database driver integration, with database client libraries linked directly into the server. In Version 2.1 AOLserver now provides an additional, loosely-coupled architecture, where AOLserver redirects all database requests to a separate process known as the database proxy daemon. This is accomplished using a special external driver, which looks just like a regular (tightly-coupled) database driver to AOLserver.

The external driver sends messages to the external database proxy daemon instead of calling database client libraries directly. This database proxy daemon can be a local or remote process. The reason for this seemingly unnecessary indirection is that some database client libraries are undesirable partners in the AOLserver process space. For example, they may make assumptions regarding per-process resources such as signals, or they may not be thread-safe. Also, platforms without support for a particular database client library can still interface with a database via a remote database proxy daemon.

A database proxy daemon is created for each connection in an AOLserver database pool. Like connections within a pool configured for an internal driver, the connections associated with proxy daemons are efficiently managed by the AOLserver on an ad hoc basis. Thus, database proxy daemon processes are created and shut down by the AOLserver as demand for concurrent database handles varies over time.

This distributed approach is not intended to replace the existing practice of linking database client libraries into the server via a driver. It merely provides an alternative interface mechanism--augmenting the choices available to developers who are extending the AOLserver database interface capabilities. It is likely, however, that this distributed approach, i.e. a separate process per database connection, will improve overall database throughput, even with the additional communication overhead. We expect this performance improvement because vendor-supplied database client libraries, running within a multi-threaded server, must limit concurrency via resource locks.

In Version 2.1, AOLserver provides database proxy daemons for both Illustra and a Sybase, while still offering the existing server-embedded Illustra and ODBC implementations.

Configuration

Configuration for an external database driver consists of setting parameters for the external driver and creating a database pool that uses that driver. An external driver is configured to spawn and communicate with a database-specific proxy daemon. Database proxy daemons are provided for Illustra and Sybase.

The external database driver parameters can be typed directly in the configuration file or set in the Setup Server by following the Database Drivers link and then the appropriate driver link.

The following example describes the steps involved in configuring an external driver to interface with the Illustra or Sybase proxy daemon.


Configure an External Database Driver
  1. Access the Setup Server by following the Setup Server link on the Administration page (/NS/Admin) for your server.

  2. On the Setup page, follow the Database Drivers link.

  3. For an Illustra proxy daemon, follow the extill link.

    For a Sybase proxy daemon, follow the extsyb link.

  4. For Illustra, enter the pathname of the MiParams file on the system where your proxy daemon will be running in the Param field.This is usually /usr/local/miadmin/MiParams.

    For Sybase, enter the value of the SYBASE environment variable.

  5. Click Update to save your changes.

  6. Back up to the top-level Setup page and configure a database pool by following the Database Pools link and then adding a database pool or following the link to the parameters for an existing database pool.

  7. For the Driver parameter of the database pool, select the extill (for Illustra) or extsyb (for Sybase) driver from the pop-up menu. Configure the remaining database pool parameters as you normally would for an internal driver.

  8. Click Update to save your changes.

  9. Restart the server to see the effects of your changes.

Remote Database Proxy Daemons

The previous example showed configuration of a local proxy daemon. One of the advantages of the external driver interface is that you are free to run database proxy daemons on any other host, perhaps one on which database vendor client libraries are more readily available or more reliable. The following example shows how to configure an interface to a proxy daemon on a remote machine.

Configure a Remote External Database Driver
  1. Access the Setup Server by following the Setup Server link on the Administration page (/NS/Admin) for your server.

  2. On the Setup page, follow the Database Drivers link.

  3. Follow the link to an external database driver (such as extill or extsyb).

  4. Click on the "Basic" icon at the top of the page to change it to an "Expert" icon, which will display the advanced parameters in addition to the basic parameters for the driver.

  5. Specify a remote host and port in the Remotehost and Remoteport parameters.

  6. Click Update to save your changes and restart your server to see the effects of your changes.

  7. Run nsillpd or nssybpd, or configure inetd as shown in the next step instead. For example:

        nsillpd 8199
    

    Or, on Windows NT, you can specify the -i switch on the command line to install it as a service, or the -r switch to remove it as a service. For example:

Install: c:\ nsillpd -i 8199
Start*: c:\ net start nsillpd-8199
Stop*: c:\ net stop nsillpd-8199
Remove: c:\ nsillpd -r 8199
*You can also use the services control panel to start and stop services.

  1. As an alternative to running nsillpd or nssybpd as shown in the previous step, you can configure inetd on the target remote machine as follows. Illustra is used in the following example. For a Sybase proxy daemon, substitute nssybpd for nsillpd and substitute sa for miadmin.

    1. Add the following line to /etc/inet/services:

        nsillpd			8199/tcp	
    

    1. Add the following line to /etc/inet/inetd.conf:

        nsillpd stream tcp nowait miadmin 
        /serverhome/bin/nsillpd nsillpd
    
    (Type the above all on one line.)

    1. Send a SIGHUP signal to your inetd process.

Tcl Interface

In addition to the built-in, database-driver independent ns_db Tcl functions, the ns_ext function is available for special functions that relate to the external driver mechanism. In general, you will not need to use ns_ext for most database operations. The ns_ext functions are used primarily by the ns_db functions, but ns_ext is provided in the event that you need to call it directly (see ns_ext).

Developing a New Database Proxy Daemon

Contact us via our website (http://www.aolserver.com) if you're interested in developing a new database proxy daemon.

Top of Page

[ Previous ] [ Contents ] [ Index ] [ Next ]
Copyright © 1996 America Online, Inc.