Database
A Database Instance is essentially a snapshot of a database at a specific point in time. It represents the current state of the data stored within the database, including all the tables, records, and their corresponding values.
Database operations use the db_ prefix on the GraphQL gateway. They cover
creating, updating and restoring database instances, reading them, and reading
each instance's backup history and backup log. Backup plans are listed with the
store's store_getProductCategoryTree and store_listProduct queries.
Verified against app.web.cloud.sabay.com (commit bcd97ff4) and the testing
gateway schema on 2026-11-16. This section was first built from the testing
gateway's introspected schema alone (2026-09-23), with no source document. It
now follows the verified Notion "Database" page, which supplies the
descriptions, sample payloads and authentication headers.
GraphQL Gateway
https://cloud-gateway.sabay.com/graphql
This is the same gateway used by Storage and
Run App. The testing environment is at
https://cloud-gateway.testing.sabay.com/graphql.
Authentication
Every request must carry both headers. See Authentication for how to get a token.
| Header | Value |
|---|---|
service-code | cloud_user |
Authorization | Bearer {token} |
Replace {token} with your own access token. Never commit tokens to source
control.
Asynchronous lifecycle
db_createDbInstance, db_updateDbInstance and db_restoreDbInstance only
confirm that the request was accepted. Provisioning, backup on/off and restore
progress are reported over WebSocket by the container_databaseActionReceived
subscription (see Real-time Events).
The UI maps the event status to the instance status (ACTIVE → Running,
PROCESSING → Processing, INACTIVE → Failed) and refetches the instance
list/detail when a non-PROCESSING event arrives.
Engines and versions
| Engine | Versions |
|---|---|
MySQL | 5.7, 8.0 |
MongoDB | 6.0, 7.0, 8.0 |
PostgreSQL | 14, 15, 16 |
MariaDB | 10.11, 11.8 |
The db_DbEngine enum values are exactly
MySQL, MongoDB, PostgreSQL, MariaDB (case-sensitive). version is a
plain String in the schema; the versions above are the UI defaults from
DB_ENGINES in the frontend, which can be overridden at runtime by
RUNTIME_MYSQL_VERSION, RUNTIME_MONGO_VERSION, RUNTIME_POSTGRESQL_VERSION
and RUNTIME_MARIADB_VERSION.
Status values
- Instance status (
db_DatabaseStatus):Processing,Running,Suspended,Failed,Cancelled - Backup status (
db_DbBackupStatus, fieldbackup.status):PENDING,SCHEDULE_DISABLE,ENABLED,SUSPENDED,FAILED,DISABLED - Backup history status
(
db_DbBackupHistoryStatus):PROCESSING,READY,RESTORING,COMPLETED,EXPIRING,EXPIRED,FAILED - Backup log
actionType(db_DbBackupLogActionType):BACKUP,RESTORE,EXPIRE,DELETE;status(db_DbBackupLogStatus):PROCESSING,SUCCESS,FAILED
Service names
Two service codes are involved, each with its own subscription:
| Service code | Used for |
|---|---|
cloud_db | Database plans / subscriptions |
cloud_db_backup | Database backup plans / subscriptions |
Keep the two subscription IDs apart. The instance's subscriptionId and the
subscriptionId you pass to create, update, list and restore is the
database (cloud_db) subscription. The instance's backup.subscriptionId
is the backup (cloud_db_backup) subscription; it goes into
dbBackupSubscriptionId on restore and into the subscriptionId filter of the
backup history and backup log queries.
Reference
| Page | Operations |
|---|---|
| Instances | db_createDbInstance, db_listDbInstancesByUser, db_updateDbInstance, db_getUserDbInstanceById, db_restoreDbInstance, container_getDbResourceUsage |
| Backups | Backup flow, store_getProductCategoryTree, store_listProduct, db_listUserDbBackupHistoryByDb, db_listUserDbBackupLogByDb |
| Types | Shared response types, pagination and enums |