Postgres
A database in its own microVM, with credentials made in your browser and a backup every day.
Create a database
A database is a service of type postgres, and it needs a plan. Create one in a project and give it:
- a name, such as
db, which other services use to reference it, - a CPU and memory size,
- a disk size, from your plan's disk.
wabi runs the official postgres image in the database's own microVM, on port 5432. It starts as soon as its credentials are signed, which the dashboard does as part of creating it.
Credentials
Your browser generates the credentials when you create the database: a password from 32 random bytes, and the variables built from it and the database's private address. It seals them like any other variables and your wallet signs them as version 1. wabi never sees them in plaintext.
| Variable | Holds |
|---|---|
POSTGRES_USER | the database user |
POSTGRES_PASSWORD | that user's password |
POSTGRES_DB | the database name |
DATABASE_URL | a connection URL to the database at its private address |
PGHOST | the database's private address |
PGPORT | 5432 |
PGUSER | the database user |
PGPASSWORD | the password |
PGDATABASE | the database name |
To see a value, open the database's variables and use Reveal with wallet. Your wallet signs a message that opens the read-back copy in your browser (Sealed variables).
Connect a service
Another service connects through a reference to the database's variables. In the app's variables, set:
DATABASE_URL=${{db.DATABASE_URL}}db is the database's service name. The reference resolves inside the app's microVM when it starts, from the database's own sealed values, so the password never passes through wabi in plaintext. The connection runs over your private network. More in Sealed variables.
Size and disk
CPU, memory and disk count against your plan (Sizes). The disk only grows. Changing CPU or memory starts a new deployment, and redeploying restarts the database with its current settings.
Backups
wabi backs up every database once a day and keeps each backup for 7 days. You can also take a backup now, once the database has run and while no other backup is in progress.
A backup runs inside your tenant, your account's own space in wabi's cluster. The password is opened in a microVM there, the dump is encrypted to your tenant key before it leaves, and only the encrypted file is stored. Like your variables, a backup opens only inside your tenant.
The backup list shows each backup's time and size.
Restore
Choose a backup and restore it. The restore runs inside your tenant, opens the backup with your tenant key, and loads it into the live database: each table and other object in the backup is dropped and recreated from it.
The restore shows running, then succeeded or failed. One restore runs at a time. To keep the current state as well, take a backup now before you restore.
Public access
A database is reachable only from your private network until you turn on public access. Then wabi opens a port for it in the range 30000–30999 and shows its endpoint:
edge.projectwabi.app:30412The dashboard assembles the public connection string from that endpoint and the read-back password, in your browser. It is not stored as a variable. With it, connect from anywhere:
psql "postgresql://<user>:<password>@edge.projectwabi.app:30412/<database>"Turning public access off closes the port.
Deleting a database
Deleting the database service deletes its volume and all its backups.