PostgreSQL Deployment
With databaseType = postgresql the Enterprise Stack stores its documents as JSONB in PostgreSQL, one table per collection.
The API connects over JDBC. It does not use the MongoDB wire protocol, and there is no migration from an existing MongoDB
database.
Loading diagram...
This is not DocumentDB. To run on DocumentDB on PostgreSQL or on Azure DocumentDB through the MongoDB wire protocol, see DocumentDB Deployment.
Prerequisites
Before you begin, ensure you have:
- An Enterprise Stack license, see Licensing. The API refuses to start without an active license.
- PostgreSQL 18, the version the Enterprise Stack is tested against.
- An empty database and a login that can create tables in it. The API creates and migrates its schema on startup.
Option 1: Quickstart
For evaluation and development. The Enterprise Stack Quickstart
ships docker-compose-postgresql.yml, which runs the API next to a postgres:18 container:
docker compose -f docker-compose-postgresql.yml up
This stack has no reverse proxy. The API listens on port 7500, so run the quickstart CLI with PORT=7500. To run it next to
the MongoDB stack, set ENTERPRISE_API_PORT to another port.
Option 2: Your Own PostgreSQL
Point the API at the primary in database.conf:
databaseType = postgresql
postgresql = {
connectionString = "jdbc:postgresql://{host}:5432/waltid_enterprise?sslmode=verify-full&sslrootcert={caFile}"
username = "{username}"
password = "{password}"
}
TLS settings go on the JDBC connection string. Pool size, PgBouncer, and the remaining fields are described in Database configuration.
Limits
- Primary only. Point every API replica at the primary. A comma-separated host list is accepted, and the API connects only to the primary in it. Reads are not split to replicas.
- Connections. A request can hold two connections. Keep
pool.maxSize(default 24) times the number of replicas, times two, undermax_connections. - Licensing.
usageCheckpointEnginemust staytrue, the default. The API refuses to start otherwise. - Queries. A filter that cannot be expressed in SQL, such as an arbitrary regular expression, is applied in memory. Such a request fails when it would scan more than 10,000 rows.
- Schema versions. The API refuses a database whose schema is newer than its own. A database created by an earlier preview of this backend is refused too: drop it and start again.
Start and Verify
A new database has no license state. Activate the license as described in Licensing. A license binds to one installation at a time.
The applied schema versions are recorded in the database:
SELECT version, remark FROM enterprise_schema_migrations ORDER BY version;
Next Steps
- Database configuration — all
postgresqlfields. - Licensing — activate the license for the new database.
- Docker deployment — run the Enterprise Stack image.
- DocumentDB Deployment — the MongoDB wire protocol on PostgreSQL.
