Infrastructure

Databases

Every BRICQS project can connect to its own managed Postgres database, provisioned in westus2 with automated backups, point-in-time restore, and SSL enforced by default.

Connecting from a deployment

The database connection string is injected at runtime as DATABASE_URL. Every container in your deployment can read it as an environment variable — no SDK required.

pythonimport os, psycopg2
conn = psycopg2.connect(os.environ["DATABASE_URL"])
cur = conn.cursor()
cur.execute("SELECT version()")
print(cur.fetchone())
javascriptimport { Pool } from 'pg';
const pool = new Pool({ connectionString: process.env.DATABASE_URL });
const { rows } = await pool.query('SELECT now()');

Connection limits

Use a connection pooler (PgBouncer or a library pool) when running multiple replicas. Each Container App replica opens connections independently — without a pooler, a burst of replicas can exhaust the server's connection limit.

Note: BRICQS will provide a built-in PgBouncer endpoint in a future release. Until then, set max_connections on your pool to 2 per replica × max_replicas.

Migrations

Run migrations from a one-off job or from your CI/CD pipeline before the new deployment is promoted to production:

bash# Example: Alembic migration before promoting
bricqs deploy migrator \
  --model microsoft/phi-3-mini-4k-instruct \
  --env preview \
  --no-wait

# Or: run psql via CI
psql $DATABASE_URL -f migrations/001_init.sql

Backups and restore

BRICQS managed databases take a full backup every 7 days and WAL backups every 5 minutes, giving point-in-time restore to any second in the past 7 days. To restore, contact support from the dashboard with your target restore point.

SSL

All connections to the managed Postgres require SSL. The CA certificate is pre-bundled into the connection string — no extra configuration is needed when connecting via a standard Postgres driver.

python# If you construct the connection string manually, include sslmode:
DATABASE_URL = "postgresql://user:pass@host:5432/db?sslmode=require"

Supported Postgres extensions

pgvector
pg_trgm
uuid-ossp
hstore
postgis
pg_stat_statements
btree_gin
citext

pgvector is pre-installed on all BRICQS Postgres instances — use it as the vector store for your RAG deployments without any extra setup.