Model

The model consists of the application logic daemon appd and the database access daemon dbproxyd. appd can host a user-implemented set of SOAP functions representing the business logic of the web application. Through dbproxyd, the business logic accesses the database.

dbproxyd

The database proxy provides access to the database. While dbproxyd exposes a RDBMS-independent interface, actual database is accessed via a driver. At the moment drivers for MySQL, PostgreSQL and SQLite exist.

Daemon Configuration

dbproxyd uses the configuration file /opt/DOMAIN/etc/dbproxyd.env. In addition to the general daemon configuration variables, dbproxyd understands the following:

  • DATABASES logical names of databases that can be accessed over this daemon. This is a comma-separated list of logical names. These names may differ from the actual names of the RDBMS.
  • USER_name username that clients must use to access the logical database name
  • PASS_name password that clients must use to access the logical database name
  • DBDRIVER_name gives the database driver for the logical database name to access the physical RDBMS. The driver is the name of a shared library in /opt/DOMAIN/lib/dbproxyd and can be one of the following:
    • DBPDriverMYSQL.so for MySQL
    • DBPDriverPGSQL.so for PostgreSQL
    • DBPDriverSQLite.so for SQLite
  • DBNAME_name is the RDBMS database name for the logical database name. For SQLite this is the absolute file name of the database file.
  • DBHOST_name is the RDBMS host name for the logical database name. This variable is not required for SQLite.
  • DBUSER_name is the RDBMS user name for the logical database name. This variable is not required for SQLite.
  • DBPASS_name is the RDBMS password for the logical database name. This variable is not required for SQLite.

Client Configuration

Clients accessing dbproxyd use the configuration file /opt/DOMAIN/etc/db.env. The following variables exist:

  • HOST host name or IP address on which dbproxyd is running. If empty, dbproxyd is assumed to run on the local host and UNIX domain sockets are used to access it.
  • PORT port number that dbproxyd is listening on. In case of UNIX domains sockets this is the file name under /var/opt/DOMAIN/sock.
  • DBNAME logical database name
  • USER user name to access dbproxyd
  • PASS password to access dbproxyd
  • FETCH specifies the number of database records to fetch at a time for SELECT statements. Default value is 10.

appd

appd hosts a user-implemented set of SOAP functions representing the business logic of the web application.

Daemon Configuration

appd uses the configuration file /opt/DOMAIN/etc/appd.env. In addition to the general daemon configuration variables, appd understands the following:

  • USER_LIBRARIES a colon-separated list of shared libraries containing user functions for process and thread contexts. Note that this is not the actual application logic but only a helper that can provide shared logic as well as process and thread level caching to the actual application logic.

Application logic

The application logic consists of all shared libraries in /opt/DOMAIN/lib/appd/. Note that appd copies each shared library to an "active" version, making it possible to update the application logic while the daemon is running by simply overwriting the original shared library. The daemon notes size and timestamp changes, unloads the old (active) version of the shared library and loads the new, updated one.