> ## Documentation Index
> Fetch the complete documentation index at: https://cockroachlabs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Multi-Region Zone Config Extensions

export const InternalLink = ({version, path = "", children, ...props}) => {
  let detectedVersion = version || "stable";
  if (typeof window !== 'undefined' && !version) {
    const match = window.location.pathname.match(/\/docs\/([^/]+)/);
    if (match) {
      detectedVersion = match[1];
    }
  }
  const normalizedPath = path.startsWith("/") ? path.slice(1) : path;
  return <a href={`/docs/${detectedVersion}/${normalizedPath}`} {...props}>
      {children}
    </a>;
};

Multi-Region *Zone Config Extensions* are a customization tool for advanced users to persistently modify the configuration generated by the standard <InternalLink path="multiregion-overview">multi-region SQL abstractions</InternalLink> on a per-region basis.

They are controlled using the <InternalLink path="alter-database#alter-locality">`ALTER DATABASE ... ALTER LOCALITY`</InternalLink> statement.

Use cases for Zone Config Extensions include:

* Failover behavior
* Regions with stale read access
* Quorum placement
* Data domiciling

We strongly recommend that most users use the <InternalLink path="multiregion-overview">default multi-region SQL abstractions</InternalLink> as much as possible. However, if you need additional customizations, using Zone Config Extensions is better than writing your own low-level <InternalLink path="configure-replication-zones">zone configs</InternalLink> for the following reasons:

* Zone Config Extensions are persistent and kept up-to-date. Unlike raw zone config modification, which must be fully overwritten on each multi-region configuration change in order to take effect, Zone Config Extensions stay in place alongside the high-level <InternalLink path="multiregion-overview">multi-region SQL configuration</InternalLink>. This is true even if you <InternalLink path="create-table">add new tables</InternalLink> or <InternalLink path="alter-database#add-region">regions</InternalLink>, or if a table's <InternalLink path="alter-table#set-locality">locality is changed</InternalLink>.
* They are validated against the configs already in place in a multi-region cluster. Unlike hand-written zone configs, they are designed to work properly with the configuration generated by the higher-level multi-region SQL statements. Specifically, this means:
  * <InternalLink path="alter-database#parameters">`REGIONAL`</InternalLink> extensions don't set <InternalLink path="configure-replication-zones">lease preferences</InternalLink>.
  * <InternalLink path="alter-database#parameters">`REGIONAL IN`</InternalLink> extensions don't set <InternalLink path="configure-replication-zones">lease preferences</InternalLink>, nor do they set <InternalLink path="configure-replication-zones">replica constraints</InternalLink> or <InternalLink path="configure-replication-zones">voter constraints</InternalLink> that would conflict with the original <InternalLink path="table-localities#regional-by-row-tables">home region</InternalLink>.
  * In no case will Zone Config Extensions change the <InternalLink path="multiregion-overview#survival-goals">survival goals</InternalLink> for the database.
  * Zone Config Extensions can set <InternalLink path="configure-replication-zones">`num_replicas`</InternalLink> as low as <InternalLink path="configure-replication-zones">`num_voters`</InternalLink>, 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 <InternalLink path="alter-database#failover-regions">Failover regions</InternalLink>.
* They are region scoped. When a Zone Config Extension is attached to a <InternalLink path="multiregion-overview#database-regions">database region</InternalLink>, any <InternalLink path="table-localities#regional-tables">`REGIONAL BY TABLE`</InternalLink> or <InternalLink path="table-localities#regional-by-row-tables">`REGIONAL BY ROW`</InternalLink> 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 <InternalLink path="multiregion-overview#table-localities">localities</InternalLink>. For example, to apply a Zone Config Extension to tables with the <InternalLink path="table-localities#global-tables">`GLOBAL` locality</InternalLink>, use <InternalLink path="alter-database#alter-locality">`ALTER DATABASE ... ALTER LOCALITY GLOBAL ...`</InternalLink>.

<Note>
  Zone Config Extensions are a property of a <InternalLink path="multiregion-overview#database-regions">database region</InternalLink>, *not* any particular <InternalLink path="schema-design-overview">schema object</InternalLink>. This differs from raw <InternalLink path="configure-replication-zones">zone configurations</InternalLink>, which may need to be assigned (and reassigned) to 10s or 100s of different schema objects on every configuration change.
</Note>

For instructions showing how to use Zone Config Extensions, see <InternalLink path="alter-database#use-zone-config-extensions">Use Zone Config Extensions</InternalLink>.

## See also

* <InternalLink path="alter-database#use-zone-config-extensions">Use Zone Config Extensions</InternalLink>
* <InternalLink path="alter-database#alter-locality">`ALTER DATABASE ... ALTER LOCALITY`</InternalLink>
* <InternalLink path="multiregion-overview">Multi-Region Capabilities Overview</InternalLink>
* <InternalLink path="data-domiciling">Data Domiciling</InternalLink>
* <InternalLink path="alter-database#placement">`PLACEMENT RESTRICTED`</InternalLink>
* <InternalLink path="alter-table#set-locality">`SET LOCALITY`</InternalLink>
* <InternalLink path="alter-database#add-region">`ADD REGION`</InternalLink>
* <InternalLink path="alter-database#set-primary-region">`SET PRIMARY REGION`</InternalLink>
* [Troubleshoot Replication Zones](/docs/v26.2/troubleshoot-replication-zones)
