Database Links (*-database, *-db)

Links to PostgreSQL database sub-components for relational data storage

🔀 Link Type Distinction

*-database (PostgreSQL)
Legacy PostgreSQL deployments
StatefulSet/Helm-based
*-db (CNPG)
CloudNativePG operator-managed
Native HA, replication, backups

🔗 Supported Link Types

*-database (PostgreSQL)

image_base-database
fastapi-database
nodejs-database
spring-database
migration-database

*-db (CNPG)

image_base-db
fastapi-db
nodejs-db
migration-db
keda-db

⚙️ Generated Environment Variables

# Automatically configured when you create a database link
POSTGRES_HOST=auto-configured
POSTGRES_PORT=5432
POSTGRES_DB={database_name}
POSTGRES_USER={database_owner}
POSTGRES_PASSWORD={database_password}
DATABASE_URL=postgresql://{user}:{password}@{host}:{port}/{db}

📄 Generated Files

Link Type Generated Files Contents
fastapi-database 📁 src/postgresql_module/ Connection helpers, SQLAlchemy models
fastapi-db 📁 src/postgresql_module/ Connection helpers, SQLAlchemy models
migration-db 📁 migrations/ Flyway/Liquibase migrations

⚖️ CNPG vs PostgreSQL Differences

Feature *-database (PostgreSQL) *-db (CNPG)
Host Service {name}-postgresql.{ns} {cluster}-rw.{ns}
Backup Support Manual/cronjob Built-in (bucket link)
HA/Replication Varies Native (sync/async)