database
Nodes
A node is one VM in the cluster โ typically an async read replica. Scale out by adding nodes; the cluster reconfigures replication automatically.
A node is one VM in a cluster. Every cluster has exactly one primary; additional nodes are async read replicas.
Add a replica
POST /database/node/add
Authorization: Bearer <token>
Content-Type: application/json
{
"cluster_id": <id>,
"image_id": 1,
"instance_type": "m1a.xlarge",
"subnet_id": 1,
"zone_id": 1,
"allocate_public_ipv4": false,
"security_group_ids": [12]
}
Required: cluster_id, image_id, instance_type, subnet_id, zone_id.
The new node is provisioned, joins the cluster as a replica, and starts streaming from the primary. Adding nodes is online โ no downtime on the primary.
Replicas can be a different instance type than the primary if you want โ pick whatever matches your read workload.
Restart one node
POST /database/node/restart
Authorization: Bearer <token>
Content-Type: application/json
{ "node_id": <id> }
Restarting the primary triggers a failover to one of the replicas โ clients see a short reconnect window. Restarting a replica is invisible to writers but causes that replicaโs connections to drop.
Terminate one node
POST /database/node/terminate
Authorization: Bearer <token>
Content-Type: application/json
{ "node_id": <id> }
Removes the node from the cluster. The cluster keeps running with the remaining nodes; the removed nodeโs storage is released.
You canโt terminate the last node โ terminate the cluster itself with cluster/terminate instead.
Read traffic
The cluster hostname resolves to the primary. To read from replicas, use the per-node hostnames returned in database/list, or use a connection pooler like PgBouncer / pgpool-II that knows about streaming replication.
Required permissions
| Action | Permission |
|---|---|
| Add | database:node:add |
| Restart | database:node:restart |
| Terminate | database:node:terminate |
Resource scoping: exc:database:node/<id>. See the Policies guide.