You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/current/v25.3/read-from-standby.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ toc: true
5
5
docs_area: manage
6
6
---
7
7
8
-
In addition to providing [failover]({% link {{ page.version.version }}/failover-replication.md %}) capabilities for disaster recovery, [**physical cluster replication (PCR)**]({% link {{ page.version.version }}/physical-cluster-replication-overview.md %}) allows you to direct read-only queries to your standby cluster. This process offloads traffic such as application reads, analytics queries, and ad-hoc reporting from the primary cluster.
8
+
In addition to providing [failover]({% link {{ page.version.version }}/failover-replication.md %}) capabilities for [disaster recovery]({% link {{ page.version.version }}/disaster-recovery-overview.md %}), [**physical cluster replication (PCR)**]({% link {{ page.version.version }}/physical-cluster-replication-overview.md %}) allows you to direct read-only queries to your standby cluster. This process offloads traffic such as application reads, analytics queries, and ad-hoc reporting from the primary cluster.
9
9
10
10
Use this page to understand how the _read from standby_ feature works and how to utilize it.
When using read from standby, applications can read from the standby cluster, but they do not connect directly to the standby cluster's AppVC. Instead, PCR introduces a _reader virtual cluster (ReaderVC)_. The ReaderVC ensures a clean, isolated environment specifically for serving read queries without interfering with replication or system metadata. It reads continuously from the standby cluster's AppVC using internal pointers, providing access to the replicated data while keeping the AppVC offline. The ReaderVC itself only stores a small amount of metadata and no user data, so it is not expected to take up additional storage space.
17
17
18
-
The standby cluster's ReaderVC has its own system tables and cluster settings. The ReaderVC replicates a subset of system tables, including **Users** and **Roles**, from the AppVC, so that existing primary users can authenticate using the same users and rolesas on the primary cluster's AppVC. Other system tables and cluster settings are set to defaults in the ReaderVC.
18
+
The standby cluster's ReaderVC has its own system tables and [cluster settings]({% link {{ page.version.version }}/cluster-settings.md %}). The ReaderVC replicates a subset of system tables, including **Users** and **Roles**, from the AppVC, so that existing primary users can authenticate using the same [users and roles]({% link {{ page.version.version }}/security-reference/authorization.md %}) as on the primary cluster's AppVC. Other system tables and cluster settings are set to defaults in the ReaderVC. For more information, consult [Physical Cluster Replication Technical Overview]({% link {{ page.version.version }}/physical-cluster-replication-technical-overview.md %}).
19
19
20
20
In the event of failover, the ReaderVC's response depends on the type of failover. After failover to the latest timestamp, the ReaderVC continues pointing to the AppVC but stops receiving updates. After failover to a point-in-time timestamp, the ReaderVC is destroyed.
21
21
@@ -24,12 +24,12 @@ In the event of failover, the ReaderVC's response depends on the type of failove
24
24
25
25
Prior to setting up read from standby, ensure that:
26
26
27
-
-you have already configured PCR between a _primary_ cluster and a _standby_ cluster. For information on configuring PCR, refer to [Set Up Physical Cluster Replication]({% link {{ page.version.version }}/set-up-physical-cluster-replication.md %}).
28
-
-your CockroachDB version is v24.3 or later. The `read from standby` option is not supported in earlier versions.
27
+
-You have already configured PCR between a _primary_ cluster and a _standby_ cluster. For information on configuring PCR, refer to [Set Up Physical Cluster Replication]({% link {{ page.version.version }}/set-up-physical-cluster-replication.md %}).
28
+
-Your CockroachDB version is v24.3 or later. The `read from standby` option is not supported in earlier versions.
29
29
30
30
### Start a PCR stream with read from standby
31
31
32
-
To start a PCR stream that allows read access to the standby cluster, use the `CREATE VIRTUAL CLUSTER ... REPLICATION` statement with the `READ VIRTUAL CLUSTER` option:
32
+
To start a PCR stream that allows read access to the standby cluster, use the [`CREATE VIRTUAL CLUSTER ... REPLICATION`]({% link {{ page.version.version }}/create-virtual-cluster.md %}) statement with the `READ VIRTUAL CLUSTER` option:
33
33
34
34
{% include_cached copy-clipboard.html %}
35
35
~~~sql
@@ -38,15 +38,15 @@ CREATE VIRTUAL CLUSTER main FROM REPLICATION OF main ON 'postgresql://{connectio
38
38
39
39
### Add read from standby to a PCR stream
40
40
41
-
To add read from standby capabilities to an existing PCR stream, use the `ALTER VIRTUAL CLUSTER` statement:
41
+
To add read from standby capabilities to an existing PCR stream, use the [`ALTER VIRTUAL CLUSTER`]({% link {{ page.version.version }}/alter-virtual-cluster.md %}) statement:
42
42
43
43
{% include_cached copy-clipboard.html %}
44
44
~~~sql
45
45
ALTER VIRTUAL CLUSTER main SET REPLICATION READ VIRTUAL CLUSTER;
46
46
~~~
47
47
48
48
{{site.data.alerts.callout_info}}
49
-
The standby cluster's AppVC must have a status of `replicating` before you can create your ReaderVC. Use the `SHOW VIRTUAL CLUSTERS` command to check the status of the AppVC.
49
+
The standby cluster's AppVC must have a status of `replicating` before you can create your ReaderVC. Use the [`SHOW VIRTUAL CLUSTERS`]({% link {{ page.version.version }}/show-virtual-cluster.md %}) command to check the status of the AppVC.
50
50
{{site.data.alerts.end}}
51
51
52
52
### Check the status of your reader virtual cluster
@@ -74,7 +74,7 @@ The ReaderVC cannot serve reads until after the PCR initial scan is complete. Af
74
74
75
75
### Run read-only queries on the standby cluster
76
76
77
-
Once you have created a reader virtual cluster on the standby cluster, you can connect to it and run read (`SELECT`) queries. For example:
77
+
Once you have created a reader virtual cluster on the standby cluster, you can connect to it and run [read (`SELECT`) queries]({% link {{ page.version.version }}/selection-queries.md %}). For example:
When using read from standby, applications can read from the standby cluster, but they do not connect directly to the standby cluster's AppVC. Instead, PCR introduces a _reader virtual cluster (ReaderVC)_. The ReaderVC ensures a clean, isolated environment specifically for serving read queries without interfering with replication or system metadata. It reads continuously from the standby cluster's AppVC using internal pointers, providing access to the replicated data while keeping the AppVC offline. The ReaderVC itself only stores a small amount of metadata and no user data, so it is not expected to take up additional storage space.
17
17
18
-
The standby cluster's ReaderVC has its own system tables and cluster settings. The ReaderVC replicates a subset of system tables, including **Users** and **Roles**, from the AppVC, so that existing primary users can authenticate using the same users and rolesas on the primary cluster's AppVC. Other system tables and cluster settings are set to defaults in the ReaderVC.
18
+
The standby cluster's ReaderVC has its own system tables and [cluster settings]({% link {{ page.version.version }}/cluster-settings.md %}). The ReaderVC replicates a subset of system tables, including **Users** and **Roles**, from the AppVC, so that existing primary users can authenticate using the same [users and roles]({% link {{ page.version.version }}/security-reference/authorization.md %}) as on the primary cluster's AppVC. Other system tables and cluster settings are set to defaults in the ReaderVC. For more information, consult [Physical Cluster Replication Technical Overview]({% link {{ page.version.version }}/physical-cluster-replication-technical-overview.md %}).
19
19
20
20
In the event of failover, the ReaderVC is destroyed.
21
21
@@ -24,12 +24,12 @@ In the event of failover, the ReaderVC is destroyed.
24
24
25
25
Prior to setting up read from standby, ensure that:
26
26
27
-
-you have already configured PCR between a _primary_ cluster and a _standby_ cluster. For information on configuring PCR, refer to [Set Up Physical Cluster Replication]({% link {{ page.version.version }}/set-up-physical-cluster-replication.md %}).
28
-
-your CockroachDB version is v24.3 or later. The `read from standby` option is not supported in earlier versions.
27
+
-You have already configured PCR between a _primary_ cluster and a _standby_ cluster. For information on configuring PCR, refer to [Set Up Physical Cluster Replication]({% link {{ page.version.version }}/set-up-physical-cluster-replication.md %}).
28
+
-Your CockroachDB version is v24.3 or later. The `read from standby` option is not supported in earlier versions.
29
29
30
30
### Start a PCR stream with read from standby
31
31
32
-
To start a PCR stream that allows read access to the standby cluster, use the `CREATE VIRTUAL CLUSTER ... REPLICATION` statement with the `READ VIRTUAL CLUSTER` option:
32
+
To start a PCR stream that allows read access to the standby cluster, use the [`CREATE VIRTUAL CLUSTER ... REPLICATION`]({% link {{ page.version.version }}/create-virtual-cluster.md %}) statement with the `READ VIRTUAL CLUSTER` option:
33
33
34
34
{% include_cached copy-clipboard.html %}
35
35
~~~sql
@@ -38,15 +38,15 @@ CREATE VIRTUAL CLUSTER main FROM REPLICATION OF main ON 'postgresql://{connectio
38
38
39
39
### Add read from standby to a PCR stream
40
40
41
-
To add read from standby capabilities to an existing PCR stream, use the `ALTER VIRTUAL CLUSTER` statement:
41
+
To add read from standby capabilities to an existing PCR stream, use the [`ALTER VIRTUAL CLUSTER`]({% link {{ page.version.version }}/alter-virtual-cluster.md %}) statement:
42
42
43
43
{% include_cached copy-clipboard.html %}
44
44
~~~sql
45
45
ALTER VIRTUAL CLUSTER main SET REPLICATION READ VIRTUAL CLUSTER;
46
46
~~~
47
47
48
48
{{site.data.alerts.callout_info}}
49
-
The standby cluster's AppVC must have a status of `replicating` before you can create your ReaderVC. Use the `SHOW VIRTUAL CLUSTERS` command to check the status of the AppVC.
49
+
The standby cluster's AppVC must have a status of `replicating` before you can create your ReaderVC. Use the [`SHOW VIRTUAL CLUSTERS`]({% link {{ page.version.version }}/show-virtual-cluster.md %}) command to check the status of the AppVC.
50
50
{{site.data.alerts.end}}
51
51
52
52
### Check the status of your reader virtual cluster
@@ -74,7 +74,7 @@ The ReaderVC cannot serve reads until after the PCR initial scan is complete. Af
74
74
75
75
### Run read-only queries on the standby cluster
76
76
77
-
Once you have created a reader virtual cluster on the standby cluster, you can connect to it and run read (`SELECT`) queries. For example:
77
+
Once you have created a reader virtual cluster on the standby cluster, you can connect to it and run [read (`SELECT`) queries]({% link {{ page.version.version }}/selection-queries.md %}). For example:
0 commit comments