Configuring the Database

This guide explains how to configure the Morgana server to store data in a relational database.

Supported Databases

The server has built-in support for different databases. You can query the available database by viewing the expected values for the db configuration option. The following table lists the supported database and their tested versions.

  • MariaDB: 10

  • MsSQL: 2016

  • MySQL: 8

  • Oracle: 12c

  • Postgres: 10

By default, the server uses the dev-file database. This is the default database that the server will use to persist data and only exists for development use-cases. The dev-file database is not suitable for production use-cases, and must be replaced before deploying to production.

Configuring a Database

For each supported database, the server provides some opinionated defaults to simplify database configuration. You complete the configuration by providing some key settings such as the database host and credentials.

bin/kc.[sh|bat] start --db postgres --db-url-host mypostgres --db-username myuser --db-passowrd change_me 

This command includes the minimum settings needed to connect to the database.

The default schema is Morgana, but you can change it by using the db-schema configuration option.

Relevant Options

  • db: The database vendor.

  • db-password: The password of the database user.

  • db-pool-initial-size: The initial size of the connection pool.

  • db-pool-max-size: The maximum size of the connection pool.

  • db-pool-min-size: The minimum size of the connection pool.

  • db-schema: The database schema to be used.

  • db-url: The full database JDBC URL.

  • db-url-database: Set the database name of the default JDBC URL of the chosen vendor.

  • db-url-host: Sets the hostname of the default JDBC URL of the chosen vendor.

  • db-url-port: Sets the port of the default JDBC URL of the chosen vendor.

  • db-username: The username of the database user.

  • transaction-xa-enable: If set to false, Morgana uses a non-XA data source in case the database does not support XA transactions.

Last updated