Database
Both the issuer and the verifier keep their state in PostgreSQL. Each service takes the same database block, and
the two use separate databases on what can be the same server.
What is stored
Session state, and nothing else that matters to a holder:
- The issuer records each issuance session — which credential configuration it is for, the pre-authorized code, the session's status — for as long as the session is live.
- The verifier records each verification session, the verification query it was started from, and the outcome.
- Both keep the body your callback answered a delivered result with, verbatim, for audit — see Accept or reject the result and Accept or reject the credential.
- Reusable configuration also lives here: the issuer's credential configurations and the verifier's verification queries persist until you remove them.
- Both keep their tenant here: the issuer or verifier itself, with its settings, its API keys and its logo — see Settings.
Verified claims are pushed to your application and are not retained as a record for you to query later. If you need the claims, configure the callback — see Receive verified data and Receive the issued credential.
Configuration
"database": {
"persistenceUnitName": "model", // (1)!
"driver": "org.postgresql.Driver", // (2)!
"url": "jdbc:postgresql://postgres:5432/verifier", // (3)!
"user": "postgres", // (4)!
"password": "postgres" // (5)!
}
- Persistence unit name. Leave this as
model. - JDBC driver class. Leave this as the PostgreSQL driver.
- JDBC connection URL. The host is resolved from inside the container, so in a Compose setup it is the service
name —
postgres— notlocalhost. - Database user.
- Database password. Do not keep the sample value — see Operating it.
The issuer's URL ends in /issuer and the verifier's in /verifier. Point them at one database and their
migrations will collide.
Creating the databases
Both databases must exist before the services start; the services create their own tables but not their own
database. In the quickstart Compose setup this is a script in
/docker-entrypoint-initdb.d:
CREATE DATABASE verifier ENCODING 'UTF8';
CREATE DATABASE issuer ENCODING 'UTF8';
Init scripts run only once
PostgreSQL executes /docker-entrypoint-initdb.d scripts only when the data directory is empty — that is, on
the very first start against a fresh volume. Editing the script later has no effect. To re-run it, drop the
volume: docker compose down -v then docker compose up -d --wait, and create the tenants again. That deletes
all data.
Settings
Each service reads server.json, which holds the settings of the server, on every start. Its tenant — the issuer
or verifier itself — is kept in its database. The service starts with no tenant, and you create it through the
admin endpoints.
What is read when
Read from server.json on every start: port, baseUrl, database, metrics and admin.
Kept in the database, and given when the tenant is created:
- Issuer:
signing(the key and the certificate chain),display_name,session_callback,authorization_server,credential_offer_prefixandstatus_list_ttl. - Verifier:
signing,alt_id_signing,client_name,session_callback,issuer_trust_anchorsandverifier_info.
Kept in the database, and changed through the admin endpoints: the API keys, the logo and, on the verifier, the issuer trust anchors.
The settings are described in the issuer and verifier configuration references.
Changing a setting
The API keys, the logo and the verifier's issuer trust anchors change while the service runs, through the admin endpoints.
Protecting it
The database holds the signing keys and the callbacks' bearer tokens, so protect it and its backups as you would the configuration files — see Going to production. API keys are stored only as hashes.
Schema migrations
Each service manages its own schema with Flyway and applies any outstanding migrations at startup. Upgrading a service image can therefore change the schema, which has two consequences worth planning for:
- Take a backup before upgrading. Migrations are applied automatically and are not reversible by restarting the old image.
- Upgrade one service at a time and confirm it starts cleanly. A failed migration stops the service from starting; the logs name the migration that failed.
Operating it
The services depend on the database being reachable. In a Compose setup, gate them on a health check rather than start order:
depends_on:
postgres:
condition: service_healthy
For anything beyond local testing:
- Do not use the sample credentials.
postgres/postgresis a placeholder for local work. See Going to production. - Back it up. Losing the database loses your credential configurations and verification queries along with in-flight sessions, and both have to be recreated by hand.
- Restrict network access. Only the two backends need to reach the database. The quickstart publishes port 5433 on the host for convenience; a real deployment should not.
What's Next
- Going to production: Credentials, backups and network exposure.
- Health endpoints: Telling whether a service can still reach the database.
- Troubleshooting: Connection and migration failures.