Skip to content

Commit 78cece9

Browse files
docs(rdb): improve read-replica documentation (#2467)
Co-authored-by: Jules Castéran <[email protected]>
1 parent 8bf6721 commit 78cece9

File tree

6 files changed

+33
-10
lines changed

6 files changed

+33
-10
lines changed

cmd/scw/testdata/test-all-usage-rdb-read-replica-create-endpoint-usage.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
22
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3-
Create a new endpoint for a given read replica.
3+
A read replica can have at most one direct access and one private network endpoint.
44

55
USAGE:
66
scw rdb read-replica create-endpoint <read-replica-id ...> [arg=value ...]

cmd/scw/testdata/test-all-usage-rdb-read-replica-create-usage.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
22
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3-
Create a read replica.
3+
You can only create a maximum of 3 read replicas for one instance.
44

55
USAGE:
66
scw rdb read-replica create <instance-id ...> [arg=value ...]

cmd/scw/testdata/test-all-usage-rdb-read-replica-reset-usage.golden

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
22
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3-
Reset a read replica.
3+
Resetting a read replica resyncs data from the leader node. This operation can take some time, depending on the database's size.
4+
During this operation, the read replica will not be available. Endpoints will not change.
45

56
USAGE:
67
scw rdb read-replica reset <read-replica-id ...> [arg=value ...]

cmd/scw/testdata/test-all-usage-rdb-read-replica-usage.golden

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
22
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
33
A read replica is a live copy of the main database instance only available for reading. Read replica allows you to scale your database instance for read-heavy database workloads. Read replicas can also be used for Business Intelligence workloads. Listing of read replicas is available in the instance response object.
4+
A read replica can have at most one direct access and one private network endpoint. Loadbalancer endpoint is not available on read replica even if this resource is displayed in the read replica response example.
5+
If you want to remove a read replica endpoint, you can use the instance delete endpoint API call.
6+
Instance Access Control List (ACL) also applies on read replica direct access endpoint. Don't forget to set it to improve the security of your read replica nodes.
7+
Be aware that there can be replication lags between the primary node and its read replica nodes. You can try to reduce this lag with some good practices:
8+
* All your tables should have a primary key
9+
* Don't run large transactions that modify, delete or insert lots of rows. Try to split it into several small transactions.
410

511
USAGE:
612
scw rdb read-replica <command>

docs/commands/rdb.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -933,12 +933,18 @@ scw rdb privilege set [arg=value ...]
933933
## Read replica management
934934

935935
A read replica is a live copy of the main database instance only available for reading. Read replica allows you to scale your database instance for read-heavy database workloads. Read replicas can also be used for Business Intelligence workloads. Listing of read replicas is available in the instance response object.
936+
A read replica can have at most one direct access and one private network endpoint. Loadbalancer endpoint is not available on read replica even if this resource is displayed in the read replica response example.
937+
If you want to remove a read replica endpoint, you can use the instance delete endpoint API call.
938+
Instance Access Control List (ACL) also applies on read replica direct access endpoint. Don't forget to set it to improve the security of your read replica nodes.
939+
Be aware that there can be replication lags between the primary node and its read replica nodes. You can try to reduce this lag with some good practices:
940+
* All your tables should have a primary key
941+
* Don't run large transactions that modify, delete or insert lots of rows. Try to split it into several small transactions.
936942

937943

938944

939945
### Create a read replica
940946

941-
Create a read replica.
947+
You can only create a maximum of 3 read replicas for one instance.
942948

943949
**Usage:**
944950

@@ -960,7 +966,7 @@ scw rdb read-replica create <instance-id ...> [arg=value ...]
960966

961967
### Create a new endpoint for a given read replica
962968

963-
Create a new endpoint for a given read replica.
969+
A read replica can have at most one direct access and one private network endpoint.
964970

965971
**Usage:**
966972

@@ -1022,7 +1028,9 @@ scw rdb read-replica get <read-replica-id ...> [arg=value ...]
10221028

10231029
### Reset a read replica
10241030

1025-
Reset a read replica.
1031+
Resetting a read replica resyncs data from the leader node. This operation can take some time, depending on the database's size.
1032+
During this operation, the read replica will not be available. Endpoints will not change.
1033+
10261034

10271035
**Usage:**
10281036

internal/namespaces/rdb/v1/rdb_cli.go

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,12 @@ func rdbReadReplica() *core.Command {
191191
return &core.Command{
192192
Short: `Read replica management`,
193193
Long: `A read replica is a live copy of the main database instance only available for reading. Read replica allows you to scale your database instance for read-heavy database workloads. Read replicas can also be used for Business Intelligence workloads. Listing of read replicas is available in the instance response object.
194+
A read replica can have at most one direct access and one private network endpoint. Loadbalancer endpoint is not available on read replica even if this resource is displayed in the read replica response example.
195+
If you want to remove a read replica endpoint, you can use the instance delete endpoint API call.
196+
Instance Access Control List (ACL) also applies on read replica direct access endpoint. Don't forget to set it to improve the security of your read replica nodes.
197+
Be aware that there can be replication lags between the primary node and its read replica nodes. You can try to reduce this lag with some good practices:
198+
* All your tables should have a primary key
199+
* Don't run large transactions that modify, delete or insert lots of rows. Try to split it into several small transactions.
194200
`,
195201
Namespace: "rdb",
196202
Resource: "read-replica",
@@ -1124,7 +1130,7 @@ func rdbInstanceRenewCertificate() *core.Command {
11241130
func rdbReadReplicaCreate() *core.Command {
11251131
return &core.Command{
11261132
Short: `Create a read replica`,
1127-
Long: `Create a read replica.`,
1133+
Long: `You can only create a maximum of 3 read replicas for one instance.`,
11281134
Namespace: "rdb",
11291135
Resource: "read-replica",
11301136
Verb: "create",
@@ -1227,8 +1233,10 @@ func rdbReadReplicaDelete() *core.Command {
12271233

12281234
func rdbReadReplicaReset() *core.Command {
12291235
return &core.Command{
1230-
Short: `Reset a read replica`,
1231-
Long: `Reset a read replica.`,
1236+
Short: `Reset a read replica`,
1237+
Long: `Resetting a read replica resyncs data from the leader node. This operation can take some time, depending on the database's size.
1238+
During this operation, the read replica will not be available. Endpoints will not change.
1239+
`,
12321240
Namespace: "rdb",
12331241
Resource: "read-replica",
12341242
Verb: "reset",
@@ -1258,7 +1266,7 @@ func rdbReadReplicaReset() *core.Command {
12581266
func rdbReadReplicaCreateEndpoint() *core.Command {
12591267
return &core.Command{
12601268
Short: `Create a new endpoint for a given read replica`,
1261-
Long: `Create a new endpoint for a given read replica.`,
1269+
Long: `A read replica can have at most one direct access and one private network endpoint.`,
12621270
Namespace: "rdb",
12631271
Resource: "read-replica",
12641272
Verb: "create-endpoint",

0 commit comments

Comments
 (0)