Databases
Yawl runs databases for your apps: it makes their passwords, keeps them on a volume, backs them up off the server, and restores them from the list.
| Kind | Versions | Reference | Backed up |
|---|---|---|---|
postgres |
17, 16 | postgres://app:…@<name>:5432/app |
every night |
valkey |
8 | redis://default:…@<name>:6379 |
with backup: true |
mysql |
8 (8.4 LTS) | mysql://app:…@<name>:3306/app |
every night |
mongodb |
8 (8.0) | mongodb://app:…@<name>:27017/app?authSource=admin&replicaSet=rs0 |
every night |
Adding one
In yawl.yaml:
services:
- name: cache
kind: valkey
backup: true # Valkey only; Postgres is always backed up
backup_at: "04:00" # UTC, default 03:00
memory: 256MB
Or New service and the database’s card. A database has no repository, image, port or release command: apps reach it by reference.
Reaching it from an app
Set a variable to a reference: yawl env set api REDIS_URL --ref cache.url, or in the app’s Environment pick Reference a database. Where the code reads REDIS_URL, the new service form offers the environment’s Valkeys; for DATABASE_URL, its Postgres, MySQL and MongoDB databases. The URL is sealed: the panel never sees it in clear.
Valkey
Valkey is the open source fork of Redis (BSD license) and speaks the same protocol, so Redis clients, BullMQ, Sidekiq and the rest work with REDIS_URL. Yawl runs it:
- with its data on disk, written every second (append only file), so a restart keeps it;
- with
noeviction: when its memory limit is full it refuses new writes rather than dropping keys, so a queue never loses a job silently. Give it amemorylimit sized for the data; - inside its environment only: no outside port, no sharing over the private network in this version.
With backup: true its data volume is backed up every night, encrypted to the recovery key, kept like Postgres’s backups (7 daily, 4 weekly). Restore makes a new Valkey with its own password: yawl db restore cache <backup> --into cache-2, then point the apps’ reference at cache-2.url.
MySQL
MySQL 8.4 LTS, with a database app and a user app that owns it. Root has the same password and logs in only from inside the database’s own container, never over the network. The first start initialises its data and can take a minute or two; the deploy waits up to 3 minutes.
It is backed up every night like Postgres, with mysqldump --single-transaction (a consistent copy while it runs), and restored into a new MySQL from the list. Where an app reads DATABASE_URL or MYSQL_URL, the form offers it. Laravel and others that read separate DB_HOST, DB_PASSWORD and the like take the parts by hand for now: the host is the service’s name, the user and database app, the password from yawl env reveal <name> PASSWORD.
Give it a memory limit of 512MB or more: InnoDB’s buffer pool alone takes 128MB, and Yawl refuses less than 256MB. A release command does not get a snapshot of a MySQL first, as it does of a Postgres: rely on the nightly backup, or back up by hand before a risky migration.
MongoDB
MongoDB 8.0, run as a replica set of one member (rs0), so multi document transactions work and Prisma connects. The user app is its administrator; the replica set’s key file is derived from its password and copied in before it starts. The first start initialises it and can take a minute or two.
It is backed up every night with mongodump --archive: every database the app made, whatever it named it. Each collection is copied as of the moment it is read, so a backup taken while the app writes to several collections at once can hold some of a change and not the rest; schedule backup_at for a quiet hour. A restore loads them into a new MongoDB, a replica set of its own with its own password, from the list. Give it a memory limit of 1GB or more (Yawl refuses less than 512MB); its cache is sized to the limit. Where an app reads MONGODB_URI, MONGO_URL or DATABASE_URL, the form offers it.
Postgres
See the README: outside access, the private network, point the apps at a restored copy, and backups before a release.
Point in time recovery
A nightly backup loses up to a day. With pitr: true on a Postgres (or Keep 7 days of changes on its page), Yawl keeps every change of the last 7 days, and a restore can go to any second of them.
services:
- name: shop-db
kind: postgres
pitr: true
- Postgres hands over each finished write ahead log (WAL) file; the agent uploads them to the backup storage every minute, encrypted to the recovery key. A quiet database closes a file at least once a minute when anything was written.
- Every night at its backup time it also takes a base backup (
pg_basebackup) beside the dump. The 7 newest are kept, and the WAL since the oldest of them. - Turning it on or off restarts the database once.
- The page shows the window: Any second from 23 Oct 03:05 UTC to 30 Oct 17:38 UTC. It ends a few minutes before now, while the newest changes are on their way. When nothing reaches the storage for 10 minutes, the page says so; above 2GB waiting, an alert says so once a day.
Restore to a time from Backups, Restore to a time, or:
yawl db restore shop-db --at 2026-10-30T17:40:00Z --into shop-db-1740
As every restore, it goes into a new database with its own password; the live one is not touched. Postgres replays the changes up to that second, then opens. Point the apps at it as after any restore. The first restore to a time is possible after the first night with PITR on.
Importing a dump
Data from another host goes into a Yawl database with an import, on the database’s Backups tab or with the CLI:
yawl db import shop-db heroku.dump # a file on your machine, uploaded (at most 10 GB)
yawl db import shop-db https://…/dump.sql.gz # a link; a presigned S3 link works
yawl db import shop-db server:old.sql # a file already in /var/lib/yawl/agent/imports on the database's server
- Postgres takes a
pg_dumpin the custom format (-Fc) or plain SQL; MySQL amysqldumpof one database (without--databases, so it loads into this one); MongoDB amongodump --archive(without--gzip), loaded intoappwhatever the source called its database: dump one database with--db, as collections of the same name from two would meet there. A file gzipped as a whole is unpacked. Valkey and ClickHouse are not imported. - A snapshot of the database is kept on its server first, as before a release command, and the import’s output names it.
- The import is a job in the database’s deploys: snapshot, then import. The database keeps running. The first error stops the load and is shown in Postgres’s or MySQL’s own words; what loaded before it stays, and the snapshot is there.
- Only Admins can import, and each import is in the audit log. A link’s query string is never shown or logged; an uploaded file is deleted when its import ends.
- A dump from another host often names that host’s users. Make it with
pg_dump --no-owner --no-aclfor Postgres, andmysqldump --set-gtid-purged=OFFwithoutDEFINERclauses for MySQL; an import that stops on one of these says so. - Postgres loads in one transaction: a dump that stops half way, or a link that breaks off, leaves the database as it was.
How long backups are kept
Without a rule a database keeps 7 daily and 4 weekly backups. keep in yawl.yaml says otherwise, for a database or a service with volumes:
- name: shop-db
kind: postgres
keep: {daily: 14, weekly: 8, monthly: 6}
- Daily 1 to 90, weekly 0 to 52, monthly 0 to 24. A field left out keeps its default:
{daily: 14}still keeps 4 weekly. - Each keeps the newest backup of each of the last so many UTC days, ISO weeks or months that have one, so a week of failed backups does not cost the older ones; the newest backup is always kept.
- The plan shows a change, and how many backups the next successful backup deletes. Nothing is deleted when you apply.
- Postgres with PITR keeps its own 7 days of base backups and changes as well.
Backup copies
Settings > Backup storage keeps the main bucket and up to three copies: other S3-compatible buckets, with their own keys.
- After a database or volume backup succeeds, the agent copies it, still encrypted to your recovery key, to each copy. A copy that fails is shown on the backup (“Copy to eu failed: …”) and opens an incident; the backup itself stays good.
- A copy cut by a panel restart, or a copy just added, gets the newest backup within a minute. A copy whose keys are missing fails as any other.
- When retention deletes a backup, it is deleted from the copies as well; a delete a copy refused is tried again after the next good backup. Removing a copy closes its incidents.
- A restore reads the main bucket, or a copy: choose it under “Read from” in the restore dialog, a volume’s too, or
yawl db restore <db> <backup> --into <new> --from eu. Only a copy that holds that backup whole can be chosen. - PITR’s changes (WAL) and the panel’s own backup stay in the main bucket, so a restore to a time (
--at) reads the main bucket only.
MariaDB, ClickHouse and pgvector
- MariaDB (
kind: mariadb): MariaDB 11.4 LTS, user and databaseapp,DATABASE_URLasmysql://app:…@<name>:3306/app. Backed up every night withmariadb-dump; a dump can be imported. Give it at least 256 MB if you limit its memory. A compose file’s MariaDB is imported as MariaDB. - ClickHouse (
kind: clickhouse): ClickHouse 25.8 LTS, user and databaseapp,CLICKHOUSE_URLashttp://app:…@<name>:8123/app(every client library speaks HTTP). Give it at least 1 GB if you limit its memory. Withbackup: trueit is backed up every night as a dump made withclickhouse-client: each table’sCREATEstatement and its rows in ClickHouse’sNativeformat; a restore makes the tables, loads the rows, then makes the views. A materialized view without aTOtable comes back without the rows it had collected, and the dump needs free disk on the server about the size of the compressed data while it runs. Yawl does not import into it; load your own data withclickhouse-client. - pgvector: every Postgres runs the pgvector image, the official Postgres with the extension built in. Run
CREATE EXTENSION IF NOT EXISTS vector;in a migration and usevectorcolumns.