Last Friday at our meeting I spoke briefly about ideas that the DevOps core team has been kicking around about the problem of how to configure the database connections for storage modules.

Currently, each module instance is responsible for setting up its own storage. The Okapi gateway has no concept of module storage or database connection strings. For modules built using the RAML Module Builder (https://github.com/folio-org/raml-module-builder), DB connection information can be read from the system environment, from command line parameters, or from a configuration file. Okapi does provide a means for passing environment variables on to modules that it deploys, via the /_/env endpoint (https://github.com/folio-org/okapi/blob/master/doc/guide.md#environment-variables), but that environment is the same for all modules deployed from a particular Okapi instance, and is not passed on to modules deployed at a remote URL.

One idea we had was to extend the tenant initialization interface to pass information to the module. This could be used, for example, to pass a tenant-specific database connection string, with the thought that the module would not initialize its database until a tenant starts using a module.

This work is very much in the conceptual stage at this point. Any feedback about how and if this seems like it might work in your deployment environments would be very welcome. Thanks!

   wayne
---
Wayne Schneider
www.indexdata.com