You are reading Codefi Orchestrate development version documentation and some displayed features may not be available in the stable release. You can switch to stable version using the version box at screen bottom.

# Connect PostgreSQL database

Codefi Orchestrate uses PostgreSQL as Database Management System. Follow these steps to configure it when starting the Orchestrate Gateway API.

Tip

Configure each microservice using microservice-specific environment variables. Command line options are also available and take precedence over environment variables.

## Configuration

Environment Variable Command line option Description Default
API_STORE_TYPE api-store-type Type of database to use postgres
DB_USER db-user PostgreSQL user postgres
DB_PASSWORD db-password PostgreSQL password postgres
DB_DATABASE db-database Name of the PostgreSQL database postgres
DB_HOST db-host URL of the running PostgreSQL instance 127.0.0.1
DB_PORT db-port Name of the PostgreSQL database 5432
DB_POOLSIZE db-poolsize Size of the pool 0
DB_POOL_TIMEOUT db-pool-timeout Duration in seconds for which client waits for a free connection if all connections are busy 30s
DB_KEEPALIVE db-keepalive Duration in seconds of the tcp_keepalives_interval 60s

## SSL/TLS Configuration

In addition to the options above, follow these steps to configure Postgres over TLS communication. Codefi Orchestrate supports the following modes for SSL/TLS, see the official documentation for more details:

• disable: I don’t care about security, and I don’t want to pay the overhead of encryption.
• require: I want my data to be encrypted, and I accept the overhead. I trust that the network will make sure I always connect to the server I want.
• verify-ca: I want my data encrypted, and I accept the overhead. I want to be sure I connect to a server that I trust.
• verify-full: I want my data encrypted, and I accept the overhead. I want to be sure I connect to a server I trust, and that it’s the one I specify.
Environment Variable Command line option Description Default
DB_TLS_SSLMODE db-sslmode Which SSL mode to use (see values above) disable
DB_TLS_CERT db-tls-cert TLS certificate
DB_TLS_KEY db-tls-key TLS Private Key
DB_TLS_CA db-tls-ca Trusted Certificate Authority