Project

General

Profile

Actions

DB Worker Node Add-on » History » Revision 10

« Previous | Revision 10/14 (diff) | Next »
Udo Offermann, 03.04.2013 15:25


DB Worker Node Add-on

The DB Worker Node Add-on is a all-in-one-system z2 installation comprising the z2-Environment plus a database (at the moment H2 Database Engine and Apache Derby are supported). The purpose is to have a quick and easy system setup like development or demonstration environments. Of course one can use it also for productive systems if H2 or Derby fulfills your requirements.

The add-on provides wrapper components that launches the actual database during the z2 bootstrap. Since the wrapper is launched on a separate z2 worker node (i.e. the DB Worker node) the database runs in server mode from the web applications point of view (which are running on the web worker node).

Using the DB Worker Node Add-on

At first one have to tell the z2-Environment where to find the DB Worker Node Add-on. Usually this is done in the environment module which is used to describe the overall system setup. The file dbWorkerAddon.properties attached to this page is a z2 repository component for this add-on which you can directly add to the environment.

At second the DB worker must be launched in addition to the web worker (and maybe also a job worker). The so called home layout is defined inside environment/home.properties. Attached to this page is a modified home.properties that launches the DB worker and afterwards the web worker, simply replace the existing home.properties file by this attached version.

Alternatively you can change the home layout manually:

home.properties:

home
com.zfabrik.component.type=com.zfabrik.homeLayout
home.workers = com.zfabrik.db.environment/h2Worker, environment/webWorker

Note that com.zfabrik.db.environment/h2Worker precedes environment/webWorker so that the DB is up and running before the web worker is started.
To use Derby instead of H2 you simply replace the home.workers by

home.workers = com.zfabrik.db.environment/derbyWorker, environment/webWorker

The DB worker node is fully transparent to the web applications so there is no need for further changes. As usual you have to make sure that the applications on the web worker are using the corresponding JDBC drivers and database client settings (connection string, user and password etc). Also using migration tools like flyway or other automatic schema generation feature as provided by hibernate for example can be used as usual.

Updated by Udo Offermann over 11 years ago · 10 revisions