Postgres database
Every app gets its own PostgreSQL database, backed up continuously.
Built on PostgreSQL, PgBouncer and WAL-G
Plans: Every plan, including the free app
What you get
- A PostgreSQL database for each app
- Connection pooling included
- Migrations that run before a new version goes live
- A snapshot before every migration
- Continuous backups, kept for 30 days
- An empty database of its own for each preview
How it works
Each app reads one setting, DATABASE_URL, and connects with any PostgreSQL driver. Connections pass through PgBouncer, which shares a small set of database connections between requests. Each app has its own database and its own login, so one app cannot read another's data.
You name a migration command in the app's whisk.yaml. On each deploy, Whisk takes a snapshot, runs the command, and only then sends traffic to the new version. If the migration fails, the snapshot is restored and the previous version stays live.
WAL-G copies every change as it is written, so the database can be restored to any minute in the last 30 days. See backups and restore. The open-source (MIT) templates use ordinary tools: Drizzle for TypeScript, SQLAlchemy and Alembic for Python, pgx and goose for Go.
Example
A plumbing merchant runs its quotes and trade accounts in one app. When a developer adds delivery zones to the customer table, the migration runs during the deploy. Counter staff keep working on the old version until the new one is ready.
For your coding agent
database: app migrate: "node dist/migrate.js" # a plain command: the image has no npm or shell
Read the tables before planning a change with whisk db schema --json. Connection settings are listed in the environment reference.