A managed database is PostgreSQL, MySQL (Percona Server), MariaDB or Valkey (Redis-compatible) run by FFxF in one of your private networks: backed up continuously, restorable to any minute of the last 7 days, updated in a window you choose, with a publicly trusted certificate. You get a connection string; FFxF keeps the engine, the system and the backups running. Managed databases are in beta, open to every account.
Create a database
curl -s https://api.ffxf.net/v1/databases/options -H "Authorization: Bearer $FFXF_TOKEN"
curl -s -X POST https://api.ffxf.net/v1/databases \
-H "Authorization: Bearer $FFXF_TOKEN" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"name": "orders", "vpc": 12, "size_gb": 1}'
{ "data": { "id": 7, "name": "orders", "status": "pending", "engine": "postgresql", "version": "18", "region": "montreal", "size_gb": 1,
"connection": { "host": "private-k3v9x2m1qa.db.ffxf.cloud", "port": 5432, "database": "defaultdb", "username": "ffxfadmin", "ssl_mode": "verify-full" } } }
"engine" picks postgresql (the default), mysql,
mariadb or valkey; GET /databases/options lists
their versions, the sizes with their hourly, monthly and yearly prices (the same for every
engine), and the extensions. By default, billing starts now, by the hour,
like a machine: the account needs 24 hours of credit. The database is ready within a few
minutes, when status goes from pending to
active. It comes with an admin user, ffxfadmin, and a logical
database, defaultdb (Valkey: the admin default, and no logical
database).
By the hour, the month or the year
Add "billing": "monthly" or "yearly" to pay for the database by the
month (the price of 730 hours) or the year (ten months). It starts by the hour; the first
period comes out of your credit if it is enough, otherwise an invoice waits for it
(billing.pending_invoice, with its link) and the database stays hourly until it
is paid. Every response describes the billing:
"billing": { "mode": "monthly", "rate": null, "price": "14.60", "currency": "CAD",
"renews_at": "2026-11-16T05:00:00Z", "pending_invoice": null }
By the hour, mode is hourly and rate gives the rate.
By the month or the year, price is the price of the period, extra disk
included, and renews_at when it is due. The console offers the same choice at
creation, and the switch to monthly or yearly later, on the database's Billing card.
Engines
| Engine | Versions | Port | TLS, as the client sets it |
|---|---|---|---|
| PostgreSQL | 19, 18 (default), 17 | 5432 | sslmode=verify-full&sslrootcert=system |
| MySQL (Percona Server) | 8.4 | 3306 | --ssl-mode=VERIFY_IDENTITY |
| MariaDB | 11.8 | 3306 | --ssl-verify-server-cert |
| Valkey (Redis-compatible) | 8.1 | 6379 | rediss://, or --tls for valkey-cli and redis-cli |
Every engine gets the same backups, forks, read replicas, high availability, public access, maintenance window and disk. Backups differ for Valkey (hourly snapshots, see below); users and logical databases differ for MySQL, MariaDB and Valkey.
Connect
curl -s https://api.ffxf.net/v1/databases/7/credentials -H "Authorization: Bearer $FFXF_TOKEN"
{ "data": { "users": [ { "username": "ffxfadmin", "admin": true, "databases": null, "read_only": false, "password": "…", "connection_uri": "postgresql://ffxfadmin:…@private-k3v9x2m1qa.db.ffxf.cloud:5432/defaultdb?sslmode=verify-full&sslrootcert=system" } ],
"connection_uri": "postgresql://ffxfadmin:…@private-k3v9x2m1qa.db.ffxf.cloud:5432/defaultdb?sslmode=verify-full&sslrootcert=system",
"public_connection_uri": null } }
Machines of the private network reach the database at connection.host,
on the engine's port. TLS is always required, with a Let's Encrypt certificate renewed for
you: sslmode=verify-full checks both the certificate and the name.
sslrootcert=system needs libpq 16 or later; with an older client, point
sslrootcert at the system bundle
(/etc/ssl/certs/ca-certificates.crt on Debian and Ubuntu).
mysql --host=private-k3v9x2m1qa.db.ffxf.cloud --user=ffxfadmin -p --ssl-mode=VERIFY_IDENTITY defaultdb
valkey-cli -u "rediss://default:$VALKEY_PASSWORD@private-k3v9x2m1qa.db.ffxf.cloud:6379" PING
Passwords only come out of GET …/credentials and of the calls that create
one, under the databases.write scope: a monitoring key with
vms.read sees the database but cannot log in. Give the connection string to
your application through an environment variable or a secret store, never in code.
Users, databases and extensions
curl -s -X POST https://api.ffxf.net/v1/databases/7/users \
-H "Authorization: Bearer $FFXF_TOKEN" -H "Content-Type: application/json" \
-d '{"username": "app", "databases": ["app"]}'
curl -s -X POST https://api.ffxf.net/v1/databases/7/databases/defaultdb/extensions \
-H "Authorization: Bearer $FFXF_TOKEN" -H "Content-Type: application/json" \
-d '{"extension": "vector"}'
A new user gets a generated password, returned once by the call (and readable later with
…/credentials); it is live within seconds. Names are lowercase letters,
digits and _; up to 30 users and 30 logical databases. The admin is not a
superuser, but owns the logical databases and connects to all of them.
Extensions come from a list: vector (pgvector), postgis,
pg_trgm, pgcrypto, uuid-ossp, hstore,
citext, unaccent, ltree and a few more, all listed
by GET /databases/options. Removing one does not cascade: if objects still
depend on it, it stays, and the database's warning says why.
Access per database
A user connects only to the logical databases in databases: it reads and
writes every table there, creates new ones, and has no access to the others. Without
databases, it connects to all of them, including those created later. With
"read_only": true, it only reads. Give each application its own user,
limited to its database.
curl -s -X PATCH https://api.ffxf.net/v1/databases/7/users/reporting \
-H "Authorization: Bearer $FFXF_TOKEN" -H "Content-Type: application/json" \
-d '{"databases": ["app", "stats"], "read_only": true}'
A change applies within seconds, and the user's open connections are closed where its
access goes down. "databases": null gives it every database back; a field
left out keeps its value. Its connection string points to defaultdb, or to
its first database when it has no access to defaultdb. A deleted logical
database leaves the lists: created again under the same name, it gives access to no one.
In the console, it is the Access button of each user.
On PostgreSQL, a user creates its tables in the public schema with no
GRANT needed, and also reads and writes the others' tables in its databases.
A role the admin creates in SQL needs GRANT CONNECT ON DATABASE to enter a
database.
MySQL and MariaDB
Users, logical databases and access are managed through the API or the console, not in
SQL. Each user has all rights in its databases (SELECT and
SHOW VIEW when read only) and none elsewhere. The admin can pass its own on
(GRANT), but a right given that way on a whole database is removed at the next
change made through the API or the console. The admin has no SUPER, FILE or
CREATE USER, and no rights on the mysql schema. There are no
extensions. Slow queries come from performance_schema, values replaced by
?, without the user.
Valkey
The admin is default: a client that only sends a password
(AUTH <password>, rediss://:<password>@…) connects as
it. Other users are ACL users: every key, every channel and every data command, including
KEYS, FLUSHALL, SORT, INFO and
CONFIG GET. Server commands (CONFIG SET, ACL,
SAVE, SHUTDOWN, MODULE, MONITOR…) are
refused. There is nothing to create for databases: the 16 numbered ones
(SELECT 0 to 15) are open to every user, with no per-database access or read only.
curl -s -X PATCH https://api.ffxf.net/v1/databases/9 \
-H "Authorization: Bearer $FFXF_TOKEN" -H "Content-Type: application/json" \
-d '{"eviction_policy": "allkeys-lru"}'
About 60 % of the size holds the data (data_memory.max_bytes); the rest runs
the system and the snapshots. eviction_policy says what happens when it is
full: noeviction, the default, refuses writes and keeps everything;
allkeys-lru removes the least used keys, for a cache; the
volatile-* policies only remove keys that expire. Every write reaches the disk
within a second. Off-site, a snapshot is taken every hour when there were writes: all are
kept 24 hours, then one a day for 7 days. A restore brings back the last snapshot taken
before the chosen minute. The slow queries are the commands with the most total time
since the engine started, and statistics count commands rather than commits.
Backups and restore
Backups are automatic and included: a full backup every week, a differential every day,
and the transaction log archived continuously. They are encrypted before they leave the
database and kept 7 days, outside the server that runs it. Every week, the latest full
backup is restored as a test and checked (backups.last_restore_test).
curl -s -X POST https://api.ffxf.net/v1/databases/7/restore \
-H "Authorization: Bearer $FFXF_TOKEN" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"at": "2026-10-14T09:30:00Z", "name": "orders-before-migration"}'
A restore never overwrites: it creates a new database, billed like any
other, holding the data as it was at that minute, with the same users and passwords. Any
minute of backups.restore_window works (GET …/backups). A
deleted database keeps its backups 7 days, so it can still be restored that way. Before
a risky migration, POST …/backups starts a backup on the spot.
Forks
curl -s -X POST https://api.ffxf.net/v1/databases/7/forks \
-H "Authorization: Bearer $FFXF_TOKEN" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"name": "orders-staging"}'
A fork is a new database whose data is an instant copy of the source, whatever its size:
a staging copy, a test of a migration, an analysis that must not load production. It
starts linked to its source: no backups of its own, and the source
cannot be deleted. After 7 days, or with POST …/detach, it gets its own copy
of the data (about 30 seconds of downtime) and its backups start.
Read replicas
curl -s -X POST https://api.ffxf.net/v1/databases/7/replicas \
-H "Authorization: Bearer $FFXF_TOKEN" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"name": "orders-read"}'
For all four engines. A read replica is one more database, of the same size and in the same private network, that follows the database continuously and only serves reads: send it reports and heavy queries, through its own host name, without loading the main database. It is placed on separate hardware whenever possible, and billed like any database of its size. Allow a few minutes before it follows the database, more for a large database.
It has the users, passwords and logical databases of the database it follows: change
them there, never on the replica, which has no backups of its own either. It refuses
every write. Replication is asynchronous: a read can be a moment
behind, as told by replica.lag_seconds (replica.status is
seeding during the first copy, then streaming, or
catching_up while it catches up).
| Engine | First copy, then following | After a failover of the database it follows |
|---|---|---|
| PostgreSQL | From the latest backup, then continuously. A very long read can be cancelled if it holds back incoming changes for too long. | It follows the new server, unless it had already received writes the standby did not have: it must then be recreated. |
| MySQL, MariaDB | From the latest backup, without loading the database, then continuously, over TLS. Stopped for a long time, it catches up by itself. | It copies itself again from the new server's first backup, taken right away: a few minutes without reads. |
| Valkey | A full copy over the network, then continuously, over TLS. FFxF gives it the users and eviction policy of the database it follows, which Valkey replication does not carry. | It resynchronises with the new server. |
Valkey: the replica checks the certificate of the database it follows. Ask for one once that certificate is in place, within minutes of the database's creation.
curl -s -X POST https://api.ffxf.net/v1/databases/12/promote \
-H "Authorization: Bearer $FFXF_TOKEN"
POST …/promote turns a replica into an independent, writable database
within seconds: it first applies what it has received, keeps the data and users it has
at that moment, and its own backups start right away. This cannot be undone, and the
followed database is left untouched. While a database has replicas (two at most), it
can be neither resized nor deleted: delete or promote them first.
High availability
curl -s -X PUT https://api.ffxf.net/v1/databases/7/high-availability \
-H "Authorization: Bearer $FFXF_TOKEN" \
-H "Content-Type: application/json" \
-d '{"enabled": true}'
For all four engines. With high availability, the database has a standby: a copy kept up to date continuously, on separate hardware, that serves no queries and waits. If the database goes down, the standby takes its place automatically, in under a minute. The database keeps its id, host names, users, passwords, backups and billing: your applications only have to reconnect. A new standby is then prepared without any action on your side.
Enable it at creation ("high_availability": true in
POST /databases; the standby is prepared after the first backup) or
later, on a database that already has one finished backup (Valkey: and its
certificate). Allow a few minutes: high_availability.status is
preparing, then ready; degraded means no standby
can take over right now, until it is put back.
high_availability.lag_seconds tells how far behind it is, and
last_failover_at when the last failover happened.
What happens during a failover
- The database has not answered for 30 seconds (machine cut off, engine stopped) and its standby has lost the stream for 20 seconds. Both are required: a standby that still receives the database proves it is alive, even if we no longer see it.
- The standby becomes the database. It applies what it has received, then accepts writes, about ten seconds after the decision.
- The names follow: the private name has a 30-second time to live when high availability is on, and the public name and IPv4 access follow as well.
- The former machine is stopped. If it cannot be (cut off from the network), it has already closed itself: without news from us or from its standby for 20 seconds, it turns read-only before the standby takes its place, so that two databases do not take writes at the same time.
- A new standby is prepared, on hardware separate from the database's.
| Engine | Outage: database machine cut off, until the failover | Planned failover: writes lost |
|---|---|---|
| PostgreSQL | 39 s | none |
| MySQL | 37 s | none |
| MariaDB | 31 s | none |
| Valkey | 40 s | none |
Measured in production on November 30 and December 1, 2026, one outage and one planned failover per engine. Writes resume about ten seconds after the failover; an application that goes through the name finds the new server when its DNS cache expires (30 seconds at most). Weekly updates are applied to the standby first, which then takes the place of the database through a planned failover: the database stops cleanly once the standby has everything, and your applications reconnect once, with no write lost.
On the application side
- Connect through the host name, never the address: the name follows the failover. Do not keep the address longer than the name's time to live (the JVM, for instance, keeps it 30 seconds by default).
- Plan for reconnecting: after a failover or an update, open connections are cut. A
pool that checks connections before lending them (SQLAlchemy's
pool_pre_ping,testOnBorrow…) and retries a few times with a one or two second pause is enough. - Only retry what can be retried: a write sent when the connection was cut may or may not have been committed. An idempotent operation is safe to replay.
- Allow a minute and a half at worst for an outage (failover, promotion, name time to live), under a minute for a planned failover.
Billing and limits
The standby is billed like the database, at the same period: the price doubles, by
the hour, by the month or by the year. Enabled during a paid month or year, it is
charged to your credit right away for the rest of the period (402 if the
credit does not cover it); disabled during a paid period, its share is not refunded
and the price goes back to that of a single database at the next renewal. It is not a
database of its own and does not count in your quota.
Replication is asynchronous: at an outage, the very last writes can
be missing. A database with high availability cannot change size: disable, resize,
enable again. MySQL and MariaDB: after a failover, the new server restarts its backups
with a full one, right away; a restore to a time between the failover and the end of
that backup gives the database as it was at the failover.
{"enabled": false} deletes the standby without interrupting the database.
This is not a read replica: a replica serves reads and never replaces the database on its own; the standby serves nothing and replaces it by itself.
Change size
curl -s -X POST https://api.ffxf.net/v1/databases/7/resize \
-H "Authorization: Bearer $FFXF_TOKEN" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"size_gb": 2}'
Moves the database to a larger size from GET /databases/options: more vCPU,
memory and included disk. Data, users, names and addresses stay the same. The database
restarts: one to two minutes of downtime, during which status is
maintenance and resize.to_gb the size asked for; then it is
active with its new size_gb. Engine settings that depend on memory
(PostgreSQL buffers, the InnoDB buffer pool, Valkey data memory) follow. The new rate applies
from the next hour; a monthly or yearly database pays the difference, prorated over the rest
of its period, from credit. Larger sizes only: the disk does not shrink. Also in the console, under
Settings.
Public access
curl -s -X PUT https://api.ffxf.net/v1/databases/7/public-access \
-H "Authorization: Bearer $FFXF_TOKEN" -H "Content-Type: application/json" \
-d '{"enabled": true, "sources": ["203.0.113.10", "2001:db8::/48"]}'
Off at creation. Once on, the database also answers at
public_access.host on its own port (kept for its whole life), over IPv4 and
IPv6, TLS and password still required. sources restricts who may connect;
omitted it is left as is, null or empty lets everyone in. Changes apply
within about 30 seconds. Prefer the private network whenever the client runs at FFxF.
Day to day
| Action | Call | Good to know |
|---|---|---|
| Statistics | GET /databases/{id}/metrics?range=24h | CPU, memory, connections and commits per minute; 1h, 24h or 7d, kept 7 days. |
| Slow queries | GET /databases/{id}/queries | The 20 queries with the most total time, normalized ($1, $2… or ?); on Valkey, per command. |
| Eviction (Valkey) | PATCH /databases/{id} with eviction_policy | Applied within seconds; noeviction by default. |
| Maintenance window | PATCH /databases/{id} with maintenance_day and maintenance_hour | Sunday 3 a.m. Montréal time by default, 2 hours. Minor updates are applied then, usually with a minute or two of downtime. |
| Disk | PATCH /databases/{id} with disk_cap_gb | The disk grows by itself at 80 % full, up to the cap. At the cap, an e-mail warns you; nearly full, the database turns read-only until the cap is raised or data deleted. |
| Size | POST /databases/{id}/resize with size_gb | Larger sizes only; one to two minutes of downtime, new rate from the next hour. |
| Delete | DELETE /databases/{id} | Billing stops; the backups stay 7 days. Refused while a linked fork depends on it. |
Limits and billing
Three databases per account by default, more on request from the console. A database is billed by the hour, the month or the year according to its size; disk beyond what the size includes costs 0.15 CAD per GB per month, counted in the hourly rate or in the renewal price. Backups, restores, the weekly restore test and public access are included.
Useful details
Reading needs vms.read (no passwords); creating, restoring, forking and resizing need
vms.create and an Idempotency-Key; deleting needs
vms.destroy; detaching a fork needs vms.action; a backup on
demand needs backups.write; public access needs network.write.
Passwords, users, logical databases, extensions and settings need
databases.write. The MCP server exposes the same actions: see
MCP tools.