Skip to main content

Databases

Seven Swarmd services keep relational state, plus Keycloak. How they share Postgres is the single most consequential choice you make at install time.
Pick your layout before you install. Each mode stores data in different databases and PVCs, so switching later is a pg_dump / pg_restore exercise, not a values change. The chart will happily render the new mode and quietly point at empty databases.

Who stores what

Keycloak always gets its own database, in every mode. Its ~100-table data model has no business mingling with application schemas.

The three layouts

One Postgres pod. Seven databases inside it, plus Keycloak’s. One shared PVC.
Pick this when you want DB-level isolation between services without running eight Postgres instances. It’s the shipped default and the best-trodden path.The trade-off: every service shares one PVC and one set of resource limits. When audit grows, it competes with everything else for the same disk.
postgres.mode is validated at render time. A typo fails the install with “postgres.mode must be one of: database-per-service, schema-per-service, instance-per-service” rather than producing a half-wired release.

Sizing guidance

In instance-per-service mode, anything you don’t override inherits postgres.storage / postgres.resources. Reasonable starting points:

Bring your own Postgres

For anything you care about, run Postgres properly — RDS, Cloud SQL, CloudNativePG, your DBA’s cluster — and point the chart at it.
${db} is a placeholder the chart substitutes per serviceregistry, agent_relay, audit and so on from the table above. So one template covers every service.

One database instead of seven

If your managed instance gives you a single database and you want the services to share it with a schema each — the external equivalent of schema-per-service:
With singleDatabase set, ${db} resolves to that one name for every service and each gets its own schema. Flyway creates the schema on first migration.
The chart does not create databases on an external server — it has no superuser and no business having one. Before installing, create:
  • Each database from the table above (or the single singleDatabase), and
  • A role with full rights on them.
Flyway handles tables, indexes and schemas from there.
keycloak.deploy=true with postgres.deploy=false is not supported, and the chart fails the render rather than pretending. The bundled Keycloak needs a host and port, and the chart won’t parse them out of an arbitrary JDBC URL.Bringing your own Postgres? Bring your own Keycloak too — see external Keycloak.
Put it in the JDBC URL — the chart passes the template through verbatim:
Mounting a CA bundle into every service is not something the chart does for you today; if you need verify-full with a private CA, talk to us.

ClickHouse

Audit and registry write their long-window history to ClickHouse when it’s enabled. It’s off by default, and the platform works without it — the long-window scan endpoints simply return empty results.
Renders ClickHouse with embedded Keeper. Fine for a single node; not a replicated production topology.
Turn ClickHouse on if you plan to use the audit dashboards or trace history in anger. Turning it on later is a helm upgrade, but history is only recorded from that point — there is no backfill.

Backups

The chart does not back anything up. What to point your tooling at: Also back up the swarmd-generated-credentials Secret. It holds the encryption-key that registry, relay, teams and the UI use for data at rest. Restoring a database without it leaves you with rows you cannot decrypt.

Next

Ingress

Real hostnames and TLS.

Presets

Tested values files for each layout.