Skip to content

Managed Databases

A managed database is a PostgreSQL or MySQL database that Mengi provisions, runs and backs up for you on one of your Kubernetes clusters. You choose the engine, size and availability tier; Mengi handles the rest and gives you connection details for your apps.


Engines and versions

Engine Versions
PostgreSQL 18, 17, 16
MySQL 8.4, 8.0

The newest version is selected by default; choose an older one if your app needs it.


Tiers

Tier What you get Runs on Fee
Single One database node. Simple and cheapest; ideal for development and smaller apps. Any cluster, including shared €19 / month
High Availability (HA) Three nodes with automatic failover, if the primary fails, another takes over. A Dedicated HA cluster €79 / month
Replicated Your database spread across two clusters (e.g. different regions): one primary handles writes, the other is a read-only standby you can promote to primary. Two Dedicated HA clusters €179 / month per replication group

Single runs on any cluster (including the Shared tier). HA and Replicated each run three database nodes, so they need a Dedicated HA cluster (or a Dedicated cluster with autoscaling enabled), one such cluster for HA, two for Replicated.

The fee is a flat platform fee per database, metered per second while the database is running and added to your account balance like the cluster platform fee (see Billing). Compute and storage come from the cluster the database runs on and are billed through that cluster, there is no separate storage line for a database. A Replicated database is charged once for the whole replication group; the standby on the second cluster is included.


Where a database runs

A database runs on the same clusters as your deployments you pick the cluster (or, for Replicated, the clusters) when you create it, and can create a new cluster inline from the wizard. This means your app and its database can sit in the same cluster for low-latency, private connectivity.


Part 1, Create a database

Start from New database in the dashboard. The wizard has five steps.

1. Engine

Choose PostgreSQL or MySQL and a version.

2. Tier

Choose Single, High Availability, or Replicated (see Tiers).

3. Cluster(s)

  • Single / HA, pick one cluster.
  • Replicated, pick two clusters (the primary’s cluster and the standby’s). You can create a cluster inline if you don’t have one yet.

4. Configuration

  • Database name, the initial database to create (default app).
  • Storage, disk size in GB (default 10). Can be increased later.
  • CPU, cores reserved for the database (default 0.5).
  • Memory, memory reserved, in MB (default 512).
  • Max connections, connection limit (default 100).
  • Backups, on by default (see Backups).
  • External access, off by default; see Connecting. (Always on for Replicated, since cross-cluster replication needs it.)

5. Review

Confirm and create. The database moves through pending → provisioning → running. Once running, you can fetch its connection details.


Connecting to your database

Once the database is running, open it in the dashboard to see its connection details:

  • Host and port (5432 for PostgreSQL, 3306 for MySQL)
  • Database name and username (app)
  • A connection string (host, user and database, without the password)

The password is not shown on the database page. Instead, the database publishes its credentials as a secret: the database page shows the secret’s name and links to the Secrets page, where the credentials live. The recommended way to use them is to reference that secret from your deployment’s environment variables, the password is injected into your app and never has to be copied around.

Private vs. external access:

  • Private (default), the database is reachable only from inside its cluster. Apps deployed to the same cluster connect over the private network the most secure option.
  • External access (optional), enable it to also get a public endpoint (host + port) so you can connect from outside the cluster, e.g. from your laptop or another environment.

Database user and privileges (PostgreSQL)

Your PostgreSQL credentials belong to the user app, which owns the database. It is not a superuser.

  • Extensions, app can install PostgreSQL’s trusted extensions with plain SQL, for example CREATE EXTENSION pg_trgm; (also pgcrypto, citext, hstore, unaccent, btree_gin, btree_gist, fuzzystrmatch, tablefunc and the other trusted contrib extensions).
  • Schemas, tables and grants, as the owner, app can create schemas and everything in them, and grant privileges on its objects.
  • Extra roles (PostgreSQL 16 and later), app can run CREATE ROLE and CREATE USER, for example to separate a migration role that owns the tables from a restricted runtime role under Row-Level Security. app manages the roles it creates, including their passwords (CREATE ROLE runtime LOGIN PASSWORD '…';), but can’t make them superuser, replication or BYPASSRLS roles. Mengi only shows the credentials of app. On PostgreSQL 15 and earlier, app can’t create roles.
  • Extra databases, app can run CREATE DATABASE, so one instance can hold several databases: for tools that need a scratch or test database, or applications that use several databases together. Backups and restores always cover all of them. To run a separate application, create a separate database in Mengi: it gets its own credentials, backups and resources.

Instances created before these privileges were added don’t have them. To check, run SELECT rolcreaterole, rolcreatedb FROM pg_roles WHERE rolname = current_user;. A restored copy keeps the privileges of the instance it was restored from, so to get them on an older instance, create a new instance and copy your data into it with pg_dump and pg_restore.


Backups

  • Automatic daily backups run on a schedule and are kept for a retention period (default 14 days). PostgreSQL additionally archives its write-ahead log continuously, so a restore into a new database includes changes made after the most recent daily backup.
  • On-demand backups, trigger a backup yourself at any time.
  • The Backups tab lists every backup that currently exists, scheduled and on-demand, as seen on the cluster. It is refreshed hourly, so a backup that just completed can take up to an hour to appear; backups older than the retention period drop off the list once they are removed.
  • Backups are stored off-site (separate from the cluster) and sent over an encrypted connection.
  • Backup storage key, the database uploads its backups with a storage key kept as the Secret db-backup-s3-creds in the database’s namespace, so anyone who can read Secrets on the cluster can read it. Whoever holds the key can download the full contents of this database’s backups. If the database is a copy restored from another database, the key can also read all of that other database’s backups, but not change them; it reaches no further back than that one database. The key can also overwrite or delete this database’s own backup files; storage then keeps the earlier version for 30 days, and the key can neither delete those versions nor change the storage’s settings.
  • Own storage per database, a database keeps its backups in storage of its own (the storage path, s3_path, of its backups contains -db-), and its key reaches no other backups of your databases or deployments, apart from reading the backups a copy was restored from. Databases created before 19 October 2026 may still use storage shared by your organization (an s3_path without -db-): their key can read, overwrite and delete the backups of every database and deployment in the organization. That storage also keeps earlier versions, which the key cannot delete. Contact support to move such a database to storage of its own.

Restoring

There are two ways to get data back from a backup.

Restore in place

Overwrite a database with one of its own backups through the API (POST /databases/{id}/restore with the backup_id of a completed backup from the Backups list) or the MCP server (restore_database). Works for PostgreSQL and MySQL.

  • Same database, same connection details, the database keeps its name, host, port, user and password. Apps only need to reconnect once it is back.
  • Exactly the backup you chose, the database returns to the state that backup captured. Everything written after it is replaced.
  • Safety backup first, before anything is overwritten, Mengi takes a backup of the current data (listed with type pre_restore). If that backup fails, nothing is changed: the database stays running and shows why the restore did not happen.
  • Downtime, while the restore runs the database shows the status restoring and is unavailable for most of that time; it is back to running when done. How long it takes grows with the database’s size. Changing, backing up or deleting the database waits until the restore has finished.
  • If it fails after the data was replaced, the database goes to error; the pre_restore backup still holds the data from before the restore. Contact support to recover it.
  • Earlier backups expire as usual, for PostgreSQL, the backups from before the restore (including the pre_restore one) stay in the Backups list for the retention period, counted from the restore, and are then removed.
  • Not yet available for databases in a Replicated group, and not from the dashboard.
  • Backups taken before in-place restore existed may not be restorable this way (the API says so); choose a more recent backup.

Restore into a new database (PostgreSQL)

Create a database through the API or the MCP server with restore_from_database_id set to the original. The new instance starts from the original’s backups and replays its archived write-ahead log, so it contains the latest state the backups hold, up to the last archived change.

  • The original keeps running untouched. The copy has its own name, password and connection secrets: point your apps at it, and delete the original once you no longer need it.
  • No backup selection, the copy always recovers the latest state; choosing a specific backup or an earlier moment isn’t supported for copies.
  • Requirements, the original must have backups enabled and at least one completed backup; the copy belongs to the same organization and can run on another cluster.
  • Duration, the copy is ready once it has downloaded the latest backup and replayed the log written since then, so it grows with the database’s size and how much changed since the last daily backup.

Point-in-time restore

Restoring to a moment you choose (point-in-time restore) isn’t available: neither restore takes a target time. An in-place restore returns the database to exactly the backup you pick; a restore into a new database recovers the latest state, up to the last archived change. The continuous write-ahead log archive is what makes that latest state possible for PostgreSQL; MySQL has no such archive, so its restores stop at the backup.

To be able to go back to a moment before a risky change (a migration, a bulk update), take an on-demand backup right before it: once it has completed, you can restore in place to it.

Neither restore is available from the dashboard yet.


Resizing

You can change these on a running database (the change is applied in place):

  • Storage, increase the disk size.
  • CPU and memory, adjust the reserved resources.
  • Max connections, raise or lower the limit.

High availability & replication

  • HA tier runs three nodes and fails over automatically if the primary becomes unhealthy.
  • Replicated tier streams data from the primary cluster to a standby cluster. The standby is read-only; if you need to switch over, you can promote it to become the new primary from the dashboard.

Deleting a database

Deleting a database removes it and its storage from the cluster. Deleting a member of a Replicated set removes the whole replication group. Deletion is permanent and also deletes the database’s backups, to keep the data, restore a copy into a new instance first (see Restoring) or export it with pg_dump / mysqldump.


Good to know

  • Databases bind to the cluster you place them on, keep a database and the app that uses it on the same cluster for private, low-latency access.
  • HA and Replicated need Dedicated HA clusters (or Dedicated clusters with autoscaling enabled) because they run three nodes; Single works anywhere.
  • Pick storage and resources with some headroom, you can scale them up later, but you can’t shrink storage.