Skip to main content

External Database Configuration

The server is configured by default with an inbuilt H2 database which is not recommended for enterprise deployment. Enterprise self-hosted deployments of Lifecycle or Firewall need to use an external PostgreSQL database. Lifecycle Cloud uses PostgreSQL in all instances.

  • PostgreSQL 10.7 or newer for IQ Server releases 184 and prior

  • PostgreSQL 14.0 or higher for IQ Server releases 185 and higher

  • PostgreSQL-compatible service (such as Amazon Aurora PostgreSQL).

Note

Having a low-latency network connection between the server and the database is crucial or the performance will notably degrade.

The external database configuration is set in the Config YAML. The connection parameters should be passed using environment variables.

export DATABASE_TYPE=postgresql
export DATABASE_HOSTNAME=<your_db_hostname>
export DATABASE_PORT=<your_db_port>
export DATABASE_NAME=<your_db_name>
export DATABASE_USERNAME=<your_db_user>
export DATABASE_PASSWORD=<your_db_password>

Add the following to the config YAML

database:
  type: ${DATABASE_TYPE}
  hostname: ${DATABASE_HOSTNAME}
  port: ${DATABASE_PORT}
  name: ${DATABASE_NAME}
  username: ${DATABASE_USERNAME}
  password: ${DATABASE_PASSWORD}
  ## optional key-value pairs to be appended to the database connection URL
  #parameters: 
    #example-param-key-name: example-param-value

Maximum Pool Size

You can configure the database connection pool size using the maxConnections parameter in the config.yml database setup. This parameter defines the maximum number of connections that are made to the external database.

Alternatively, you can configure the database connection pool size through system properties. For more details, refer Configuring with Java System Properties.

The appropriate pool size depends on your deployment scale. The following values can be used as a reference:

Deployment Size

Recommended maxConnections

Small

45 (default)

Medium

100

Large

200

Troubleshoot external database connections

When the server fails to start:

  1. Review the system logs to verify database connection values are passed correctly

  2. Verify the database user has write permission

  3. Check for network or service disruptions with the database

  4. Use the healthcheck endpoint to monitor the health of the server and the database

GET http://localhost:8071/healthcheck

See Operational Menu