Databases

Managed PostgreSQL, Redis, and vector databases with backups, replicas, and branching.

Managed PostgreSQL

Provision a PostgreSQL database in seconds:

rf add postgres
✓ PostgreSQL 16 provisioned (plan: starter)
✓ DATABASE_URL injected into environment
  Host: pg-abc123.raidframe.net
  Port: 5432
  Database: myapp
  User: rf_user

Plans

PlanCPUMemoryStorageConnectionsPrice
StarterShared256 MB1 GB25Free
Standard1 vCPU1 GB10 GB100$7/mo
Pro2 vCPU4 GB50 GB300$25/mo
Pro Plus4 vCPU8 GB100 GB500$50/mo
Performance8 vCPU16 GB500 GB1000$100/mo
Performance XL16 vCPU32 GB1 TB2000$200/mo
rf db upgrade main --plan pro

Supported Versions

PostgreSQL 14, 15, and 16. Default is 16.

Extensions

rf db extensions list main
rf db extensions enable main pgvector

Supported extensions: pgvector, pg_trgm, postgis, hstore, uuid-ossp, pg_stat_statements, btree_gin, btree_gist, citext, ltree, tablefunc.

Connect Directly

# Open psql shell
rf db connect main

# Run a query
rf db query main "SELECT count(*) FROM users"

# Local proxy (localhost:5432 → remote database)
rf db proxy main
✓ Proxy running: localhost:5432 → pg-abc123.raidframe.net:5432
  Connect with: psql postgresql://rf_user:****@localhost:5432/myapp
  Press Ctrl+C to stop

Backups

Automatic daily backups with 30-day retention. Point-in-time recovery to any second.

# List backups
rf db backups main

# Create manual backup
rf db backup main --name before-migration

# Restore to point in time
rf db restore main --to "2026-03-15T14:30:00Z"

# Restore from named backup
rf db restore main --backup before-migration

Import & Export

# Import from SQL dump
rf db import main ./backup.sql

# Import from pg_dump format
rf db import main ./backup.dump --format custom

# Export full database
rf db export main --output ./backup.sql

# Export specific tables
rf db export main --tables users,orders --output ./partial.sql

Read Replicas

Add read replicas in any region:

rf db replicas add main --region eu-west-1
rf db replicas add main --region ap-southeast-1
✓ Read replica created in eu-west-1
  URL: DATABASE_REPLICA_EU_URL (auto-injected)

Connection Pooling

PgBouncer is built in. Connection pooling is enabled by default with transaction mode.

rf db pool main --mode session    # For prepared statements
rf db pool main --mode transaction # Default, best for most apps
rf db pool main --size 200         # Max pool connections

Managed Redis

rf add redis
✓ Redis 7.2 provisioned
✓ REDIS_URL injected into environment

Redis Plans

PlanMemoryConnectionsPersistencePrice
Starter256 MB100NoFree
Standard1 GB500AOF$10/mo
Pro4 GB2000AOF + RDB$30/mo
Performance16 GB5000AOF + RDB$80/mo

Configuration

rf db config cache maxmemory-policy allkeys-lru
rf db config cache maxmemory 2gb

Vector Database

For AI/ML workloads — store and query embeddings:

rf add vector
✓ Vector DB provisioned
✓ VECTOR_URL injected into environment

Use for semantic search, RAG pipelines, recommendation engines, and similarity matching. Compatible with the OpenAI embeddings API format.

Schema Diff

Compare schemas between environments:

rf db diff main --env production --env staging
SCHEMA DIFFERENCES (production → staging)
──────────────────────────────────────────
+ TABLE user_profiles (staging only)
  + id uuid PRIMARY KEY
  + user_id uuid REFERENCES users(id)
  + bio text
  + avatar_url text

~ TABLE users
  + COLUMN phone_number varchar(20)  (staging only)
  ~ COLUMN name: varchar(100) → varchar(255)  (staging)

Query Insights

View slow queries and index recommendations:

rf db insights main
SLOW QUERIES (avg > 100ms, last 24h)
─────────────────────────────────────
1. SELECT * FROM orders WHERE user_id = $1 ORDER BY created_at DESC
   Avg: 340ms  Calls: 12,847  Total: 4,367s
   ⚡ Recommendation: CREATE INDEX idx_orders_user_created ON orders(user_id, created_at DESC);

2. SELECT * FROM products WHERE name ILIKE $1
   Avg: 180ms  Calls: 3,201  Total: 576s
   ⚡ Recommendation: CREATE INDEX idx_products_name_trgm ON products USING gin(name gin_trgm_ops);