Concepts
Managed databases
PostgreSQL 17 on a managed VM, reachable only from one private network over TLS, with continuous WAL archiving and point-in-time restores.
A managed database is PostgreSQL 17 on a service VM that Ankra runs for you. It is reachable only from one of your private networks: the firewall admits port 5432 from that network only, and PostgreSQL accepts only the database owner, over TLS with a SCRAM password, to its one database.
Plans#
| Plan | Cores | Memory | Price per month | Backup retention |
|---|---|---|---|---|
db-1c-2g (default) |
1 | 2 GiB | €15 | 7 days |
db-2c-4g |
2 | 4 GiB | €40 | 7 days |
db-4c-8g |
4 | 8 GiB | €80 | 14 days |
Storage is 10 to 1024 GiB (default 20) at €0.12 per GiB-month. GET /v1/databases/plans returns the current list.
The database's VM, disks and backups are not billed on their own. An account holds at most 5 databases.
Creating a database#
curl -X POST https://cloud.ankra.app/v1/databases \
-H "Authorization: Bearer $ANKRA_CLOUD_TOKEN" \
-H 'Content-Type: application/json' \
-d '{ "zone": "se-sto1", "name": "orders", "network_id": "<network-id>", "database_name": "orders" }'
The answer carries the database, a database.create operation and the credentials (owner name, password and a
connection URI with the password). Show them again with GET /v1/databases/{id}/credentials, or rotate the password
with POST /v1/databases/{id}/reset-password; the VM switches within seconds.
database_name and owner_name (default: the database name) are lowercase SQL identifiers.
Scaling up or down#
Move a running database to another plan, larger or smaller, with Change plan on its page or:
curl -X POST https://cloud.ankra.app/v1/databases/<database-id>/plan \
-H "Authorization: Bearer $ANKRA_CLOUD_TOKEN" \
-H 'Content-Type: application/json' \
-d '{ "plan": "db-2c-4g" }'
The database.change_plan operation stops the database's VM, gives it the new plan's cores and memory, and starts it
again, so the database is unavailable for a few minutes; plan the change for a quiet moment and have clients
reconnect. The VM stays on its host when the host has room, and otherwise moves cold to another host in the zone. Its
data disk, private address, password, certificate and backups are unchanged, and so is the backup retention it was
created with. The new price applies from the hour the change finishes.
A change that cannot complete (for example, no host in the zone has room for the larger size) fails and is followed by
a database.start operation that starts the VM again on the size it had, so the database does not stay down. Storage
size is not changed by a plan change.
Growing storage#
Grow a running database's data disk, online, with Grow storage on its page or:
curl -X POST https://cloud.ankra.app/v1/databases/<database-id>/resize \
-H "Authorization: Bearer $ANKRA_CLOUD_TOKEN" \
-H 'Content-Type: application/json' \
-d '{ "storage_gibibytes": 50 }'
The database.resize operation grows the disk's volume, the hypervisor presents the new size to the running VM, and the
guest agent grows the file system under PostgreSQL: nothing restarts and clients keep their connections. The
operation finishes once the database reports a file system of the new size, usually within a minute, and only then is
the new size shown and billed. Storage only grows, up to 1024 GiB, and does not count against your account's storage
quota.
Growing needs the platform to know the size of the database's file system, and GET /v1/databases/{id} says up
front whether it does (storage_growth_available, with storage_growth_unavailable_reason when not); the console
disables Grow storage with the same reason. There are three reasons, and only one is yours to act on:
- The database's host cannot report it yet. The platform has to update the host first; restarting the database now would not help. Afterwards the reason either goes away or turns into the next one.
- The database started before online growth was introduced. It has to restart once: change its plan (which restarts it; you can change back afterwards) or ask support to restart it, and it grows storage online from then on.
- The database has not measured its file system yet, right after it started. Try again in a minute.
If a growth runs out of time waiting for the database, the operation fails and says so, the disk already has its new
size, and the storage shows and is billed at the new size as soon as the database finishes growing it, without
another request; your audit log records that as database.storage_grown. If a growth fails part-way the disk may
already be larger than the size shown; ask again for at least that size to finish it.
A create (or restore) that times out because its zone could not be reached, for example during a zone outage, leaves
the database in error only for a while: Ankra Cloud starts the same operation again by itself, five minutes after the
failure and then backing off to once an hour, and the database turns running once the zone serves it again. A create
refused for good (an invalid request, a quota) is not retried; delete the database instead.
Connecting with TLS#
Every zone has a database certificate authority, and each database a server certificate from it naming its private
address and tls_server_name, renewed automatically. The connection_uri uses sslmode=verify-full: save the zone
authority from GET /v1/databases/{id} (ca_certificate) as ~/.postgresql/root.crt, or pass it as sslrootcert.
Plain-text connections are refused.
Backups and point-in-time recovery#
PostgreSQL archives every WAL segment (at least every 60 seconds) with pgBackRest to object storage in the zone, encrypted client-side, and takes a full base backup daily around 02:30 UTC plus one right after creation. Backups and WAL are kept for the plan's retention window, which is also how far back a restore reaches.
Restore never overwrites: POST /v1/databases/{id}/restore creates a new database from the source's backups,
recovered to target_time or to the latest archived point. Deleting a database takes a final full backup first
and keeps its backups for the retention window, so a deleted database stays restorable by its id until then.
Locations without backups. Backups need object storage in the location. Where there is none,
GET /v1/zones/{zone}/capabilities says so (database_backups: false, with database_backups_reason), and
POST /v1/databases answers 409 unless the request sets "acknowledge_no_backups": true. Such a database cannot be
restored, its deletion takes no final backup, and its data is gone once it is deleted. GET /v1/databases/{id} says
whether a database keeps backups (backups_available, with backups_unavailable_reason).
Availability#
A database is a single instance. If its VM dies, its host restarts it; if its host dies, the database VM is restarted on another host with the same volumes (see Live migration and HA). Either way clients see an outage of that length. Replicas and automatic promotion are not offered yet.