From c007aea6e319befbc2a688bd3f850ff92633c4fd Mon Sep 17 00:00:00 2001 From: Rich Loveland Date: Tue, 27 Jan 2026 14:51:30 -0500 Subject: [PATCH 1/2] Document how to use Zone config extensions to remove read replicas Fixes DOC-15023 --- src/current/v26.1/alter-database.md | 9 +++++++++ src/current/v26.1/zone-config-extensions.md | 1 + 2 files changed, 10 insertions(+) diff --git a/src/current/v26.1/alter-database.md b/src/current/v26.1/alter-database.md index be043a3d568..3d05ffaa1c2 100644 --- a/src/current/v26.1/alter-database.md +++ b/src/current/v26.1/alter-database.md @@ -833,6 +833,15 @@ SHOW ZONE CONFIGURATION FROM DATABASE movr; (1 row) ~~~ +In a multi-region database, the default zone configuration may include additional non-voting replicas (for example, to support [follower reads]({% link {{ page.version.version }}/follower-reads.md %})). The database's [survival goal]({% link {{ page.version.version }}/multiregion-overview.md %}#survival-goals) depends only on the number of voting replicas (`num_voters`), not the total number of replicas (`num_replicas`). + +If you want to reduce storage costs by removing non-voting replicas, you can use Zone Config Extensions to set `num_replicas` equal to `num_voters`: + +{% include_cached copy-clipboard.html %} +~~~ sql +ALTER DATABASE movr ALTER LOCALITY REGIONAL CONFIGURE ZONE USING num_replicas = 3; +~~~ + We will now use `ALTER DATABASE ... ALTER LOCALITY` to overwrite the `lease_preferences` field to add `us-west1` to the list of regions: {% include_cached copy-clipboard.html %} diff --git a/src/current/v26.1/zone-config-extensions.md b/src/current/v26.1/zone-config-extensions.md index 7e01f0076a3..ecdb86fe53e 100644 --- a/src/current/v26.1/zone-config-extensions.md +++ b/src/current/v26.1/zone-config-extensions.md @@ -24,6 +24,7 @@ We strongly recommend that most users use the [default multi-region SQL abstract - [`REGIONAL`]({% link {{ page.version.version }}/alter-database.md %}#parameters) extensions don't set [lease preferences]({% link {{ page.version.version }}/configure-replication-zones.md %}#lease_preferences). - [`REGIONAL IN`]({% link {{ page.version.version }}/alter-database.md %}#parameters) extensions don't set [lease preferences]({% link {{ page.version.version }}/configure-replication-zones.md %}#lease_preferences), nor do they set [replica constraints]({% link {{ page.version.version }}/configure-replication-zones.md %}#constraints) or [voter constraints]({% link {{ page.version.version }}/configure-replication-zones.md %}#voter_constraints) that would conflict with the original [home region]({% link {{ page.version.version }}/table-localities.md %}#regional-by-row-tables). - In no case will Zone Config Extensions change the [survival goals]({% link {{ page.version.version }}/multiregion-overview.md %}#survival-goals) for the database. + - Zone Config Extensions can set [`num_replicas`]({% link {{ page.version.version }}/configure-replication-zones.md %}#num_replicas) as low as [`num_voters`]({% link {{ page.version.version }}/configure-replication-zones.md %}#num_voters), which removes non-voting replicas while preserving the database's survival goal. - They are composable. You can use Zone Config Extensions to build up approximations of many higher-level features. For an example, see [Failover regions]({% link {{ page.version.version }}/alter-database.md %}#failover-regions). - They are region scoped. When a Zone Config Extension is attached to a [database region]({% link {{ page.version.version }}/multiregion-overview.md %}#database-regions), any [`REGIONAL BY TABLE`]({% link {{ page.version.version }}/table-localities.md %}#regional-tables) or [`REGIONAL BY ROW`]({% link {{ page.version.version }}/table-localities.md %}#regional-by-row-tables) tables associated with that region will have their zone configurations updated according to the settings passed via the extension. As mentioned above, this updated config will also be persisted in the face of other multi-region configuration changes. - They are locality scoped. You can specify a Zone Config Extension that only applies to tables with certain [localities]({% link {{ page.version.version }}/multiregion-overview.md %}#table-localities). For example, to apply a Zone Config Extension to tables with the [`GLOBAL` locality]({% link {{ page.version.version }}/table-localities.md %}#global-tables), use [`ALTER DATABASE ... ALTER LOCALITY GLOBAL ...`]({% link {{ page.version.version }}/alter-database.md %}#alter-locality). From fd6978345996c776388fb5c6100070d84561987c Mon Sep 17 00:00:00 2001 From: Rich Loveland Date: Wed, 28 Jan 2026 16:13:33 -0500 Subject: [PATCH 2/2] Update with florence-crl feedback (1) --- src/current/v26.1/alter-database.md | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/current/v26.1/alter-database.md b/src/current/v26.1/alter-database.md index 3d05ffaa1c2..7bd7408e75c 100644 --- a/src/current/v26.1/alter-database.md +++ b/src/current/v26.1/alter-database.md @@ -833,15 +833,6 @@ SHOW ZONE CONFIGURATION FROM DATABASE movr; (1 row) ~~~ -In a multi-region database, the default zone configuration may include additional non-voting replicas (for example, to support [follower reads]({% link {{ page.version.version }}/follower-reads.md %})). The database's [survival goal]({% link {{ page.version.version }}/multiregion-overview.md %}#survival-goals) depends only on the number of voting replicas (`num_voters`), not the total number of replicas (`num_replicas`). - -If you want to reduce storage costs by removing non-voting replicas, you can use Zone Config Extensions to set `num_replicas` equal to `num_voters`: - -{% include_cached copy-clipboard.html %} -~~~ sql -ALTER DATABASE movr ALTER LOCALITY REGIONAL CONFIGURE ZONE USING num_replicas = 3; -~~~ - We will now use `ALTER DATABASE ... ALTER LOCALITY` to overwrite the `lease_preferences` field to add `us-west1` to the list of regions: {% include_cached copy-clipboard.html %} @@ -875,6 +866,17 @@ The `lease_preferences` field is now updated to include `us-west1`. To remove the changes made in this example, [reset the Zone Config Extensions](#reset-a-regions-zone-config-extensions). +#### Reduce storage costs by removing non-voting replicas + +In a [multi-region database]({% link {{ page.version.version }}/multiregion-overview.md %}), the default zone configuration may include additional [non-voting replicas]({% link {{ page.version.version }}/configure-replication-zones.md %}#num_voters) (for example, to support [follower reads]({% link {{ page.version.version }}/follower-reads.md %})). The database's [survival goal]({% link {{ page.version.version }}/multiregion-overview.md %}#survival-goals) depends only on the number of voting replicas (`num_voters`), not the total number of replicas (`num_replicas`). + +If you want to reduce storage costs by removing non-voting replicas, you can use Zone Config Extensions to set `num_replicas` equal to `num_voters`: + +{% include_cached copy-clipboard.html %} +~~~ sql +ALTER DATABASE movr ALTER LOCALITY REGIONAL CONFIGURE ZONE USING num_replicas = 3; +~~~ + #### Implement super regions In this example, [Zone Config Extensions]({% link {{ page.version.version }}/zone-config-extensions.md %}) are used to provide an alternative implementation of [super regions]({% link {{ page.version.version }}/multiregion-overview.md %}#super-regions), which are useful for [data domiciling]({% link {{ page.version.version }}/data-domiciling.md %}).