Database
The Flow-Like API uses a relational database for platform data. The Prisma schema is in:
packages/api/prisma/schema/
CockroachDB (Default)
Section titled “CockroachDB (Default)”The Helm chart deploys a 3-node CockroachDB cluster by default. This provides:
- Native schema compatibility — Flow-Like’s Prisma schema is CockroachDB-first
- High availability — Automatic failover with 3 nodes
- Distributed SQL — Horizontal scaling built-in
- PostgreSQL compatible — Standard drivers work out of the box
Internal CockroachDB (default)
Section titled “Internal CockroachDB (default)”database: type: internal internal: replicas: 3 persistence: size: 10GiFor local development, a single-node cluster is sufficient:
database: type: internal internal: replicas: 1 persistence: size: 1GiExternal Database
Section titled “External Database”Use an external PostgreSQL or CockroachDB instance:
database: type: external external: connectionString: "postgresql://user:pass@host:5432/flowlike" # Or use an existing secret: existingSecret: "my-db-secret"Schema Migrations
Section titled “Schema Migrations”Helm Chart Migration Job
Section titled “Helm Chart Migration Job”The chart includes a migration job that runs on install/upgrade:
database: migration: enabled: trueManual Migration
Section titled “Manual Migration”cd apps/backend/kubernetes./scripts/migrate-db.shOr via Docker:
./scripts/migrate-db.sh --dockerRuntime Configuration
Section titled “Runtime Configuration”The API requires:
DATABASE_URL— CockroachDB/PostgreSQL connection string
This is read by flow_like_api::state::State.