Scaleway logo
Managed Database for PostgreSQL and MySQL API

A Read Replica is a live copy of a Database Instance that behaves like an Instance, but that only allows read-only connections. The replica mirrors the data of the primary Database node and any changes made are replicated to the replica asynchronously. Read Replicas allow you to scale your Database Instance for read-heavy database workloads. They can also be used for business intelligence workloads.

A Read Replica can have at most one direct access and one Private Network endpoint. Loadbalancer endpoints are not available on Read Replicas even if this resource is displayed in the Read Replica response example.

If you want to remove a Read Replica endpoint, you can use delete a Database Instance endpoint API call.

Instance Access Control Lists (ACL) also apply to Read Replica direct access endpoints.

Limitations: There might be replication lags between the primary node and its Read Replica nodes. You can try to reduce this lag with some good practices:

  • All your tables should have a primary key
  • Don't run large transactions that modify, delete or insert lots of rows. Try to split it into several small transactions.

Create a Read Replica

POST
https://api.scaleway.com
/rdb/v1/regions/{region}/read-replicas

Create a new Read Replica of a Database Instance. You must specify the region and the instance_id. You can only create a maximum of 3 Read Replicas per Database Instance.

Create a Read Replica › path Parameters

region
​string · enum · required

The region you want to target

Enum values:
fr-par
nl-ams
pl-waw

Create a Read Replica › Request Body

instance_id
​string · required

UUID of the Database Instance you want to create a Read Replica from. (UUID format)

Specification of the endpoint you want to create.

same_zone
​boolean | null

Defines whether to create the replica in the same availability zone as the main instance nodes or not.

Create a Read Replica › Responses

200
id
​string

UUID of the Read Replica. (UUID format)

Display Read Replica connection information.

status
​scaleway.rdb.v1.ReadReplica.Status · enum

Read replica status.

Enum values:
unknown
provisioning
initializing
ready
deleting
error
locked
configuring
Default: unknown
region
​string

Region the Read Replica is in.

same_zone
​boolean

Whether the replica is in the same availability zone as the main instance nodes or not.

instance_id
​string

UUID of the Database Instance.


Get a Read Replica

GET
https://api.scaleway.com
/rdb/v1/regions/{region}/read-replicas/{read_replica_id}

Retrieve information about a Database Instance Read Replica. Full details about the Read Replica, like endpoints, status and region are returned in the response.

Get a Read Replica › path Parameters

region
​string · enum · required

The region you want to target

Enum values:
fr-par
nl-ams
pl-waw
read_replica_id
​string · required

UUID of the Read Replica. (UUID format)

Get a Read Replica › Responses

200
id
​string

UUID of the Read Replica. (UUID format)

Display Read Replica connection information.

status
​scaleway.rdb.v1.ReadReplica.Status · enum

Read replica status.

Enum values:
unknown
provisioning
initializing
ready
deleting
error
locked
configuring
Default: unknown
region
​string

Region the Read Replica is in.

same_zone
​boolean

Whether the replica is in the same availability zone as the main instance nodes or not.

instance_id
​string

UUID of the Database Instance.


Delete a Read Replica

DELETE
https://api.scaleway.com
/rdb/v1/regions/{region}/read-replicas/{read_replica_id}

Delete a Read Replica of a Database Instance. You must specify the region and read_replica_id parameters of the Read Replica you want to delete.

Delete a Read Replica › path Parameters

region
​string · enum · required

The region you want to target

Enum values:
fr-par
nl-ams
pl-waw
read_replica_id
​string · required

UUID of the Read Replica. (UUID format)

Delete a Read Replica › Responses

200
id
​string

UUID of the Read Replica. (UUID format)

Display Read Replica connection information.

status
​scaleway.rdb.v1.ReadReplica.Status · enum

Read replica status.

Enum values:
unknown
provisioning
initializing
ready
deleting
error
locked
configuring
Default: unknown
region
​string

Region the Read Replica is in.

same_zone
​boolean

Whether the replica is in the same availability zone as the main instance nodes or not.

instance_id
​string

UUID of the Database Instance.


Create an endpoint for a Read Replica

POST
https://api.scaleway.com
/rdb/v1/regions/{region}/read-replicas/{read_replica_id}/endpoints

Create a new endpoint for a Read Replica. Read Replicas can have at most one direct access and one Private Network endpoint.

Create an endpoint for a Read Replica › path Parameters

region
​string · enum · required

The region you want to target

Enum values:
fr-par
nl-ams
pl-waw
read_replica_id
​string · required

UUID of the Read Replica. (UUID format)

Create an endpoint for a Read Replica › Request Body

​scaleway.rdb.v1.ReadReplicaEndpointSpec[] · required

Specification of the endpoint you want to create.

Create an endpoint for a Read Replica › Responses

200
id
​string

UUID of the Read Replica. (UUID format)

Display Read Replica connection information.

status
​scaleway.rdb.v1.ReadReplica.Status · enum

Read replica status.

Enum values:
unknown
provisioning
initializing
ready
deleting
error
locked
configuring
Default: unknown
region
​string

Region the Read Replica is in.

same_zone
​boolean

Whether the replica is in the same availability zone as the main instance nodes or not.

instance_id
​string

UUID of the Database Instance.


Promote a Read Replica

POST
https://api.scaleway.com
/rdb/v1/regions/{region}/read-replicas/{read_replica_id}/promote

Promote a Read Replica to Database Instance automatically.

Promote a Read Replica › path Parameters

region
​string · enum · required

The region you want to target

Enum values:
fr-par
nl-ams
pl-waw
read_replica_id
​string · required

UUID of the Read Replica. (UUID format)

Promote a Read Replica › Request Body

Promote a Read Replica › Responses

200
created_at
​string | null · date-time

Creation date (must follow the ISO 8601 format). (RFC 3339 format)

Volumes of the Database Instance.

region
​string

Region the Database Instance is in.

id
​string

UUID of the Database Instance. (UUID format)

name
​string

Name of the Database Instance.

organization_id
​string

Organization ID the Database Instance belongs to. (UUID format)

project_id
​string

Project ID the Database Instance belongs to. (UUID format)

status
​scaleway.rdb.v1.Instance.Status · enum

Status of the Database Instance.

Enum values:
unknown
ready
provisioning
configuring
deleting
error
autohealing
locked
Default: unknown
engine
​string

Database engine of the database (PostgreSQL, MySQL, ...).

​scaleway.rdb.v1.UpgradableVersion[]

Available database engine versions for upgrade.

tags
​string[]

List of tags applied to the Database Instance.

Advanced settings of the Database Instance.

​scaleway.rdb.v1.BackupSchedule

Backup schedule of the Database Instance.

is_ha_cluster
​boolean

Defines whether or not High-Availability is enabled.

high_availability_mode
​scaleway.rdb.v1.HighAvailabilityMode · enum

Defines the High-Availability mode of the instance.

Enum values:
unknown_high_availability_mode
disabled
single_zone
multiple_zone
Default: unknown_high_availability_mode
​scaleway.rdb.v1.ReadReplica[]

Read Replicas of the Database Instance.

node_type
​string

Node type of the Database Instance.

List of engine settings to be set at database initialization.

List of Database Instance endpoints.

​scaleway.rdb.v1.LogsPolicy

Logs policy of the Database Instance.

backup_same_region
​boolean

Store logical backups in the same region as the Database Instance.

​scaleway.rdb.v1.Maintenance[]

List of Database Instance maintenance events.

Encryption at rest settings for your Database Instance.


Resync a Read Replica

POST
https://api.scaleway.com
/rdb/v1/regions/{region}/read-replicas/{read_replica_id}/reset

When you resync a Read Replica, first it is reset, then its data is resynchronized from the primary node. Your Read Replica remains unavailable during the resync process. The duration of this process is proportional to the size of your Database Instance. The configured endpoints do not change.

Resync a Read Replica › path Parameters

region
​string · enum · required

The region you want to target

Enum values:
fr-par
nl-ams
pl-waw
read_replica_id
​string · required

UUID of the Read Replica. (UUID format)

Resync a Read Replica › Request Body

Resync a Read Replica › Responses

200
id
​string

UUID of the Read Replica. (UUID format)

Display Read Replica connection information.

status
​scaleway.rdb.v1.ReadReplica.Status · enum

Read replica status.

Enum values:
unknown
provisioning
initializing
ready
deleting
error
locked
configuring
Default: unknown
region
​string

Region the Read Replica is in.

same_zone
​boolean

Whether the replica is in the same availability zone as the main instance nodes or not.

instance_id
​string

UUID of the Database Instance.