Database components
APC database
The APC API uses a PostgreSQL database to store platform configuration and state. Key tables:User- System users with authentication credentialsWorkspace- Organizational units for grouping deploymentsDeployment- Airflow deployment configurationsCluster- Data plane cluster properties including cloud provider, region, and configurationRoleBinding- User and service account role assignmentsServiceAccount- API keys for programmatic accessDeployRevision- Deployment version historyTaskUsage- Task execution metrics
Airflow metadata database
Each Airflow Deployment gets its own isolated PostgreSQL database containing two schemas:
The database name is derived from the Deployment release name:
Database provisioning
Automatic provisioning
By default, the deployment orchestrator automatically provisions databases for new Deployments. No additional configuration is required.External database
To use pre-existing or managed databases, setskipAirflowDatabaseProvisioning to true in the upsertDeployment mutation:
Connection pooling (PgBouncer)
APC uses PgBouncer for connection pooling to reduce database connection overhead. Airflow can open many database connections due to its distributed nature, and each PostgreSQL connection creates a dedicated OS process. PgBouncer reduces this overhead by maintaining a pool of reusable server connections. For more detail on why PgBouncer is recommended, see the Apache Airflow Helm chart production guide.PgBouncer proxies connections to whichever database backend you configure, whether that’s the embedded PostgreSQL container or an external database you provide through a
metadataConnectionString URI. Enabling PgBouncer provides connection pooling either way.transaction pool mode by default, which means server connections are returned to the pool after each transaction completes. This mode doesn’t support session-level features such as prepared statements or SET commands that persist across transactions.
Configuration
Pool sizes
Pool sizes are configured per Deployment in the Airflow chart values:cl_waiting metric. If clients consistently wait for connections, increase pool sizes or scale PgBouncer replicas.
Airflow also maintains its own SQLAlchemy connection pool (default
pool_size: 5, max_overflow: 10) between each Airflow component and PgBouncer. With these defaults, each Airflow process can open up to 15 simultaneous database connections. The full connection chain is: Airflow component → SQLAlchemy pool → PgBouncer → PostgreSQL.Kerberos support
PgBouncer in APC includes Kerberos support:High availability
PostgreSQL replication
Replication is disabled by default. If you run the embedded PostgreSQL database despite the previous warning, the following example enables streaming replication with synchronous commit:Persistence
Default values and tuning starting points
The following tables compare the chart default values with tuning starting points based on Astronomer operational experience. The Default column reflects the values shipped in the Helm chart. Adjust these values based on the number of Deployments, workload scale, and observed resource utilization in your environment. For additional production guidance, see the Apache Airflow Helm chart production guide. Astronomer recommends using a managed database service such as Amazon RDS, Google Cloud SQL, or Azure Database for PostgreSQL rather than the embedded PostgreSQL container for production workloads.PostgreSQL
Astronomer doesn’t recommend or support the embedded PostgreSQL container for production use. The following values are tuning starting points if you run the embedded database beyond its defaults for non-production use. For production workloads, use a managed database service instead.PgBouncer (platform level)
PgBouncer (per Deployment)
These values match the Apache Airflow Helm chart defaults. No official formula ties pool sizes to a specific workload metric such as Dag count. Instead, adjust pool sizes based on observed connection utilization.Backup and recovery
For database backup and restore procedures, including size estimation,pg_dump/mysqldump commands, and restore steps, see Access Airflow database.
Connection strings
APC database
The APC database connection depends on whether you use an external database or the in-cluster PostgreSQL. You configure this during control plane installation. For external databases, provide the connection throughhouston.backendConnection in your Helm values:
houston.backendSecretName. The secret must contain a connection key with the full connection URI.
To retrieve the active APC database connection string, read the astronomer-bootstrap secret:
The in-cluster PostgreSQL option (
global.postgresql.enabled: true) is only for development or proof-of-concept environments and isn’t supported in production.Airflow database
Both the metadata and result backend connections use the same database with different schemas and credentials:Monitoring
Monitor the following metrics to track database and connection pool health:Best practices
- Enable replication for production Deployments.
- Use PgBouncer to manage connection overhead.
- Monitor connection pools for
cl_waitingand database size growth. - Configure regular backups. See Access Airflow database.
- Size pools based on observed connection utilization, not Dag count.
- Use separate credentials for each Deployment.
- Enable SSL for database connections in production.
- Use a managed database service for production workloads instead of the in-cluster PostgreSQL container.