Data

Postgres

Managed PostgreSQL in your environment’s private network, with continuous backups, point-in-time restore into a new database, and a secure tunnel from your laptop.

Create a database

Terminal
apprail databases create shop main
apprail databases create shop analytics --version 17 --storage 20 --cpu 500 --memory 1024
apprail databases shop
OptionChoices
--version16 or 17. Minor versions are kept current
--storage1–50 GB
--cpu, --memoryMillicores and MB reserved for the database; they count toward your workspace limits
--envWhich environment; production by default

It takes a minute or two to become ready. Then every service in the environment receives its variables and is updated automatically.

Connect from your app

Read DATABASE_URL. Each database also provides APPRAIL_DATABASE_<NAME>_URL, _HOST, _PORT, _NAME, _USER, and _PASSWORD — for a database called main, APPRAIL_DATABASE_MAIN_URL.

// Node.js (pg)
const pool = new Pool({ connectionString: process.env.DATABASE_URL });

# Python (psycopg)
conn = psycopg.connect(os.environ["DATABASE_URL"])

The generated URL uses sslmode=disable: the connection never leaves the environment’s isolated network, and it works the same in every client (strict certificate checks in Node and Prisma would otherwise refuse the database’s internal certificate).

Create your schema with a pre-deploy command such as npx prisma migrate deploy, so it exists before your app starts.

Connect from your computer

apprail databases connect opens a local port and prints a connection URL for psql, TablePlus, DBeaver, or a migration tool. The connection is relayed through Apprail’s API into the database and encrypted end to end; the database never gets a public address.

Terminal
apprail databases connect shop main            # 127.0.0.1:54329
apprail databases connect shop main --port 6543 --env staging

Backups

Every database is backed up continuously to offsite storage: the write-ahead log is archived as it happens, and a full base backup runs daily at 02:00 UTC. Take one yourself before a risky change:

Terminal
apprail databases backup shop main
apprail databases backups shop main

Restore

A restore never overwrites anything. It creates a new database from another one’s backups — to the latest state or to a moment you choose — and leaves the source untouched. Check the restored data, then point your app at it (or delete the old one so the restored one becomes the default).

Terminal
apprail databases restore shop main main-restored
apprail databases restore shop main main-before-bug --to 2026-09-25T14:30:00Z

Rotate the password

The database gets a new password, and about 45 seconds later every live service in the environment restarts with it. Expect a brief moment of failed connections; apps that reconnect on error handle it without help.

Terminal
apprail databases rotate-password shop main

Delete

Terminal
apprail databases delete shop main --confirm main

Deleting needs the database’s name and removes the server, its disk, and its credentials. Its backups are kept in offsite storage.

Take your data with you

Terminal
apprail databases connect shop main &
pg_dump "postgres://…@127.0.0.1:54329/…" > shop.sql

Good to know

Each database is a single instance without a standby replica. If its machine fails, the database is unavailable until it is restarted elsewhere, and data written since the last archived log segment could be lost — recoverable up to that point from backups. There’s no connection pooler or read replicas yet, and only stock Postgres extensions. Keep connection pools modest.