Managed Databases
Managed database instances, their replicas, backups and recovery runs.
Tables in this group: backup, cache, database, destination, managed, recovery, replica, retention, scope, shipment, snapshot.
backup
One completed managed-engine backup artifact recorded from the daemon's managed.backup result; unique per (managed_id, backup_id), cascades with the cluster.
| Column | Type | Required | Description |
|---|---|---|---|
id | uuid | yes | Primary key (uuidv7(), time-ordered). |
created_at | timestamp(3) with time zone | yes | Row creation time. |
managed_id | uuid | yes | Parent managed row (on delete cascade). |
database_id | uuid | no | The database row the dump was of, set null if that database is dropped; null for an instance-scope backup. |
retention_id | uuid | no | The retention whose scheduled run made this artifact; null for a manual backup or once that retention is deleted. |
server_id | uuid | no | Host that holds the on-disk artifact (the primary when the backup ran); null after that server is deleted. |
origin | text | yes | backup when a backup run made the file, import when it was brought in to be restored; existing rows are backup. |
backup_id | text | yes | Daemon-minted bk_ plus hex token that is also the artifact filename on the host; unique per managed engine, not globally. |
size_bytes | bigint | yes | Artifact size in bytes as reported by the daemon after writing the dump; re-checked before a restore. |
checksum | text | yes | Lowercase SHA-256 hex digest of the artifact computed by the daemon; a restore refuses on mismatch. |
database | text | no | Database name for a single-database backup, kept as history; null for an instance-scope backup. |
path | text | yes | Artifact path relative to the backup root of the host that made it (managed/ plus the cluster id, then the file). |
cache
One native Valkey process per row, owned by one Hosting Account in one project environment on one server; the daemon runs it as that account.
| Column | Type | Required | Description |
|---|---|---|---|
id | uuid | yes | Primary key (uuidv7(), time-ordered). |
created_at | timestamp(3) with time zone | yes | Row creation time. |
updated_at | timestamp(3) with time zone | yes | Last write time; the ORM sets it to now() on every update. |
metadata | jsonb | no | Last apply result from the daemon: runtimeVersion, lastError and appliedAt; written by the cache result handler only. |
environment_id | uuid | yes | Parent environment row (on delete cascade). |
server_id | uuid | yes | Parent server row (on delete restrict). |
principal_id | uuid | yes | The Hosting Account the process runs as; only that account may reach it, and only its sites and apps get the variables. |
name | varchar(63) | yes | Short name unique in the environment, lower case letters, digits and dashes; shown in the web interface. |
status | text | yes | Last known state: pending, applying, ready, stopped or failed; written from apply results. |
engine | text | yes | Engine binary: valkey today; redis is reserved for a later choice and refused by the API until it is offered. |
version | varchar(16) | yes | Engine series such as 8.1; the daemon maps it to the pinned patch release it vendors. |
access | text | yes | socket is a private unix socket only the account can open; port is a loopback port the host firewall opens to that account only. |
port | integer | no | Loopback port from the server listen-port ledger, set only when access is port; unique per server. |
max_memory_mb | integer | yes | Data memory limit in MiB written as maxmemory; the unit memory ceiling is twice this plus 32 MiB. |
key_prefix | varchar(64) | yes | Prefix of the variable names delivered to the account sites and apps, for example REDIS_HOST; unique per account and environment. |
password | text | yes | Sealed tpsecret envelope of the login password; only its SHA-256 is sent to the daemon, the plain value travels as a sealed variable. |
database
One database inside a managed cluster: its name, whether it has an owner role and the login chosen as its owner; written by the managed databases API.
| Column | Type | Required | Description |
|---|---|---|---|
id | uuid | yes | Primary key (uuidv7(), time-ordered). |
created_at | timestamp(3) with time zone | yes | Row creation time. |
updated_at | timestamp(3) with time zone | yes | Last write time; the ORM sets it to now() on every update. |
managed_id | uuid | yes | Parent managed row (on delete cascade). |
owner_login_id | uuid | no | Postgres only: the login the customer chose as owner; NULL means the default no-login owner role. Cleared when that login is deleted. |
name | varchar(255) | yes | Name on the engine as typed (1-255 chars); unique per cluster after case-fold. |
is_role_owned | boolean | yes | Postgres only: true when the database is owned by an owner role (tp_NAME_owner, _rw, _ro). |
destination
A named S3-compatible destination an organization copies finished backups to; the secret key is sealed and never returned by an API.
| Column | Type | Required | Description |
|---|---|---|---|
id | uuid | yes | Primary key (uuidv7(), time-ordered). |
created_at | timestamp(3) with time zone | yes | Row creation time. |
updated_at | timestamp(3) with time zone | yes | Last write time; the ORM sets it to now() on every update. |
organization_id | uuid | yes | Parent organization row (on delete cascade). |
created_by | uuid | no | User who created the target, set null if that user is deleted. |
name | text | yes | Label the organization gave the target, unique per organization, 1 to 64 characters. |
kind | text | yes | Kind of destination; only s3 (S3-compatible object storage) for now. |
endpoint | text | yes | Base URL of the storage service, for example https://s3.example.com; no path. |
region | text | yes | Region name used when signing requests; us-east-1 when the provider has no regions. |
bucket | text | yes | Bucket the copies are written to. |
prefix | text | yes | Folder inside the bucket, without a leading or trailing slash; empty for the bucket root. |
access_key_id | text | yes | Access key id for the bucket; an identifier, returned by the API. |
secret_key_sealed | text | yes | Secret access key sealed with the instance data key (tpsecret envelope); never returned by any API. |
last_tested_at | timestamp(3) with time zone | no | When the connection test last ran against this target; null before the first test. |
last_test_error | text | no | A plain reason the last connection test failed; null when it passed or was never run. |
is_path_style | boolean | yes | True addresses the bucket in the path (endpoint/bucket/key); false uses the bucket as a host name prefix. |
is_server_side_encrypted | boolean | yes | True asks the storage to encrypt each object at rest with its own key (AES256). |
is_last_test_ok | boolean | no | True when the last connection test passed, false when it failed; null before the first test. |
managed
One managed database cluster per environment (1:1 via unique environment_id); created by the managed create route, status projected by the command consumer.
| Column | Type | Required | Description |
|---|---|---|---|
id | uuid | yes | Primary key (uuidv7(), time-ordered). |
created_at | timestamp(3) with time zone | yes | Row creation time. |
updated_at | timestamp(3) with time zone | yes | Last write time; the ORM sets it to now() on every update. |
metadata | jsonb | no | Residual cluster facts: rootLoginId and rootUsername set at create, plus host, port and error written by the command consumer from daemon results. |
options | jsonb | no | Operator settings jsonb with the key settings (engine ManagedSettings), written by the managed routes; the databases are database rows. |
environment_id | uuid | yes | Owning environment; exactly one managed row per environment (unique index), cascade-deleted with it. |
server_id | uuid | no | Placement pin of the primary member's host, copied from the environment at create and re-set by the consumer only on a primary-member apply success. |
name | text | no | Operator label for the cluster (1-255 chars of letters, digits, space, dot, underscore, hyphen); null when unnamed. |
status | text | yes | Lifecycle state: provisioning at create, applying while a command is queued, then daemon-observed ready, stopped or failed projected by the consumer. |
engine | text | yes | Catalog engine code set once at create from ManagedEngineSpec: postgres, mysql, mariadb, redis or clickhouse (only the first three are creatable). |
backup_destination | text | no | This cluster's own copy choice: null follows the organization default, none turns copying off, otherwise a destination id. |
recovery
Durable HA journal entry for one managed cluster recovery (failover, switchover or DR); at most one non-terminal row per managed_id, written by the HA flow.
| Column | Type | Required | Description |
|---|---|---|---|
id | uuid | yes | Primary key (uuidv7(), time-ordered). |
created_at | timestamp(3) with time zone | yes | Row creation time. |
updated_at | timestamp(3) with time zone | yes | Last write time; the ORM sets it to now() on every update. |
metadata | jsonb | no | Fencing and progress facts: fencingEpoch, fenceCommandIds, promoteCommandId, haPresent, fenced, drainApplied, lagBytes, blockedReason. |
managed_id | uuid | yes | Parent managed row (on delete cascade). |
target_member_id | uuid | no | replica.id of the member being promoted, set null if that member is removed; null when an automatic failover was blocked with no eligible candidate. |
kind | text | yes | automatic-failover, switchover (planned promotion of a failover replica) or disaster-recovery (promotion of a remote read replica). |
source_primary_member_id | uuid | yes | replica.id of the primary being replaced, stored without an FK on purpose so the journal outlives the member. |
state | text | yes | Journal phase: detecting, fencing, promoting, repointing, reconciling-ingress, verifying, then terminal completed, failed or blocked. |
started_at | timestamp(3) with time zone | yes | When the recovery was opened; set explicitly by insertRecovery together with the initial state. |
completed_at | timestamp(3) with time zone | no | When the recovery reached a terminal state; null while still in flight. |
replica
One server's membership in a managed cluster (primary plus replicas); exactly one primary per managed_id, written by the member lifecycle and the consumer.
| Column | Type | Required | Description |
|---|---|---|---|
id | uuid | yes | Primary key (uuidv7(), time-ordered). |
created_at | timestamp(3) with time zone | yes | Row creation time. |
updated_at | timestamp(3) with time zone | yes | Last write time; the ORM sets it to now() on every update. |
metadata | jsonb | no | Daemon-observed replication health (state, observedAt, optional lagBytes, lagSeconds) written by the consumer after apply and lifecycle commands. |
managed_id | uuid | yes | Parent managed row (on delete cascade). |
server_id | uuid | yes | Host running this member; one member per server per cluster and a private port is unique per server; deleting the server is restricted. |
status | text | yes | Per-member state: provisioning, applying, ready, stopped, failed or needs_resync (set on demote or a failed fence, never auto-cleared). |
role | text | yes | primary or replica; a partial unique index allows one primary per cluster and the consumer swaps roles on promote and failover. |
replica_class | text | no | failover (same datacenter, promotable) or read (any org server, never auto-promoted); null on the primary and ignored when role is primary. |
ordinal | integer | yes | 1-based member ordinal, unique per cluster; the primary is 1 and it mirrors the engine service's container ordinal. |
replication_transport | text | no | Resolved private path from this member to the primary: local, datacenter, fabric or public; null until resolved or on the primary. |
private_port | integer | no | Host port 45000-45999 published on the member's private address for replication and ProxySQL backends; allocated per server, null for single-member clusters. |
is_read_eligible | boolean | yes | Whether the listener may route read-only logins to this member; true on the primary, operator-chosen on replicas (API field readEligible). |
retention
A scheduled backup of one managed engine or one local storage copy, pushed to its host as a systemd timer that runs without the control plane.
| Column | Type | Required | Description |
|---|---|---|---|
id | uuid | yes | Primary key (uuidv7(), time-ordered). |
created_at | timestamp(3) with time zone | yes | Row creation time. |
updated_at | timestamp(3) with time zone | yes | Last write time; the ORM sets it to now() on every update. |
organization_id | uuid | yes | Owning organization stored directly, because the target is polymorphic; cascade-deletes the policy with the org. |
managed_id | uuid | no | Parent managed row (on delete cascade). |
copy_id | uuid | no | Parent copy row (on delete cascade). |
created_by | uuid | no | User who created the policy; null for an automatic default policy or once that user is deleted. |
name | text | yes | Operator label for the policy, shown in the console's backup list. |
target_kind | text | yes | managed or copy: which of managed_id and copy_id names the target; exactly one is set (retention_target_check). |
schedule | text | yes | The schedule as authored, a cron expression or alias; translated to a systemd OnCalendar value when pushed to the host. |
timezone | text | no | IANA zone the schedule is read in; null means the host's local time. |
database | text | no | Managed target: the database each run dumps (API field database); NULL means the cluster's initial database. |
retention_keep | integer | yes | How many of this policy's own artifacts the host keeps, 1 to 100; older ones are pruned after each run. |
next_run_at | timestamp(3) with time zone | no | When the host's timer next fires, as last reported by the daemon; null until a report arrives. |
is_enabled | boolean | yes | False pauses the policy: its timer is removed from the host while the row and its run history stay. |
scope
Which databases a login may use: one row per login and database; what it may do in them is login.privileges.
| Column | Type | Required | Description |
|---|---|---|---|
id | uuid | yes | Primary key (uuidv7(), time-ordered). |
created_at | timestamp(3) with time zone | yes | Row creation time. |
updated_at | timestamp(3) with time zone | yes | Last write time; the ORM sets it to now() on every update. |
login_id | uuid | yes | Parent login row (on delete cascade). |
database_id | uuid | yes | Parent database row (on delete cascade). |
shipment
How copying one backup to one target stands, as the host reported it; keyed by the engine and the daemon's bk_ id, cascades with the cluster.
| Column | Type | Required | Description |
|---|---|---|---|
id | uuid | yes | Primary key (uuidv7(), time-ordered). |
created_at | timestamp(3) with time zone | yes | Row creation time. |
updated_at | timestamp(3) with time zone | yes | Last write time; the ORM sets it to now() on every update. |
managed_id | uuid | yes | The cluster whose backup this is. |
destination_id | uuid | no | Destination the copy went to, set null if the destination is deleted. |
server_id | uuid | no | The host that reported the latest state, set null if that server is deleted. |
backup_id | text | yes | The daemon-minted bk_ id of the backup, matching backup.backup_id; kept as text so a report can land first. |
destination_name | text | yes | Name the target had when the copy was recorded, so a deleted target still reads in plain words. |
state | text | yes | One of pending, copying, copied, failed or removed (pruned from the bucket by retention). |
error | text | no | A plain reason the copy failed; null otherwise. |
object_key | text | no | Object key in the bucket, prefix included; set once the copy is done. |
size_bytes | bigint | no | Size of the copied object in bytes as the host reported it. |
attempts | integer | yes | How many times the host tried to copy this backup. |
copied_at | timestamp(3) with time zone | no | When the host reported the copy finished; null until then. |
snapshot
One finished scheduled run of a retention, reported by the host that ran it; unique per (retention_id, run_id).
| Column | Type | Required | Description |
|---|---|---|---|
id | uuid | yes | Primary key (uuidv7(), time-ordered). |
created_at | timestamp(3) with time zone | yes | Row creation time. |
retention_id | uuid | yes | The retention this run belongs to; the run history cascades with it. |
server_id | uuid | yes | Parent server row (on delete cascade). |
status | text | yes | succeeded or failed, as reported by the host. |
run_id | text | yes | Daemon-minted id for the run, unique per policy so a report delivered twice is recorded once. |
started_at | timestamp(3) with time zone | yes | When the host started the run. |
finished_at | timestamp(3) with time zone | yes | When the host finished the run, whether it succeeded or failed. |
error | text | no | Failure text reported by the host; null when the run succeeded. |
backup_ref | text | no | The bk_ id of the artifact the run produced, matching backup.backup_id or archive.backup_id; null when it failed. |
Last updated on