# PostgreSQL (/docs/runtime/components/postgresql)



Component Category [#component-category]

Data and storage / relational database

Component Description [#component-description]

PostgreSQL is the relational database used to store structured operational data across the platform.

Why It Is Used [#why-it-is-used]

In BullSequana AI Runtime, PostgreSQL supports platform services that require durable, transactional, and queryable storage for metadata, configuration, and application state.

Learn More [#learn-more]

* [PostgreSQL documentation](https://www.postgresql.org/docs/current/)
* [postgres/postgres on GitHub](https://github.com/postgres/postgres)

Deployment notes [#deployment-notes]

PostgreSQL deploys as a CloudNativePG (CNPG) cluster. The operator installs in the `cnpg-operator` namespace at sync wave 5, and the cluster itself in the `cnpg` namespace at sync wave 6, both in the common tier. A single instance runs PostgreSQL 17 with 50Gi of persistent storage. PgBouncer provides connection pooling in transaction mode. Automated backups run daily at 02:00 UTC to the Rook Ceph RGW S3 endpoint with 30-day retention.

Per-service database roles are provisioned declaratively through CNPG `DatabaseRole` custom resources. Each `DatabaseRole` references the shared `cnpg-cluster`, a password secret, and the desired capabilities (such as `login` or `createdb`). The operator reconciles roles directly — no imperative Jobs or `psql` commands are involved. A separate permissions Job per service grants database-level privileges after the role and database exist. All role and database resources deploy at negative sync waves so they are ready before the consuming application starts.

Interacts With [#interacts-with]

* `PgAdmin`, as the operational administration console for PostgreSQL instances.
* `Keycloak`, `OpenFGA`, `Temporal`, and `Grafana`, all of which rely on PostgreSQL-backed state in this platform.
* `Argo Workflows` and higher-layer platform services, which also use PostgreSQL for durable metadata and operational data.
