To describe the types and distribution strategies of multiple data replicas, OceanBase AI Database introduces the concept of Locality. OceanBase AI Database currently supports only tenant-level Locality.
Replicas refer to the data itself, while Locality refers to the container that holds the data. This means that the distribution strategies and types of containers described by Locality apply to the data they contain.
Locality syntax
The syntax of Locality is as follows:
replicas{quantifier}@location
The following table describes elements in the syntax.
Element |
Description |
|---|---|
| replicas | The type of the replica. The value of this element is the name of the replica type. Both full names and abbreviations are supported. You can view the supported replica type names in the name column of the table in Replicas. OceanBase AI Database currently supports only full-featured replicas (F replicas). |
| location | The location of the replica. It contains a collection of values that are known to the system. The value of this element is the names of zones. You can query for the names of zones in a cluster or tenant from the oceanbase.DBA_OB_ZONES view. For more information about the DBA_OB_ZONES view, see oceanbase.DBA_OB_ZONES. |
| quantifier | The number of replicas. The value is fixed to 1, indicating only one replica. You can leave this element unspecified. |
You can query for the Locality of a tenant from the LOCALITY field in the oceanbase.DBA_OB_TENANTS view of the sys tenant. Here is an example:
obclient(root@sys)[oceanbase]> SELECT TENANT_ID, TENANT_NAME, TENANT_TYPE, CREATE_TIME, PRIMARY_ZONE, LOCALITY, COMPATIBILITY_MODE, STATUS FROM oceanbase.DBA_OB_TENANTS;
The query result is as follows:
+-----------+-------------+-------------+----------------------------+--------------+----------------------------------------------+--------------------+--------+
| TENANT_ID | TENANT_NAME | TENANT_TYPE | CREATE_TIME | PRIMARY_ZONE | LOCALITY | COMPATIBILITY_MODE | STATUS |
+-----------+-------------+-------------+----------------------------+--------------+----------------------------------------------+--------------------+--------+
| 1 | sys | SYS | 2025-12-29 15:43:42.930290 | RANDOM | FULL{1}@zone1 | MYSQL | NORMAL |
| 1001 | META$1002 | META | 2025-12-29 15:44:48.700796 | zone1;zone2 | FULL{1}@zone1, FULL{1}@zone2 | MYSQL | NORMAL |
| 1002 | mysql001 | USER | 2025-12-29 15:44:48.704354 | zone1;zone2 | FULL{1}@zone1, FULL{1}@zone2 | MYSQL | NORMAL |
+-----------+-------------+-------------+----------------------------+--------------+----------------------------------------------+--------------------+--------+
3 rows in set
Example
The following example shows how multiple tenants with different Localities coexist in an OceanBase AI Database cluster with two zones (z1 and z2):
The Locality of the
systenant:F@z1,F@z2.This indicates that the
systenant has one full-featured replica on each ofz1andz2.The Locality of tenant1:
F@z1.This indicates that tenant1 has one full-featured replica on
z1.
The following figure shows an example.

Locality and high-availability architecture
The multi-replica architecture is one of the strengths that distinguish OceanBase AI Database from conventional databases. The multi-replica architecture lays the foundation for multi-level lossless disaster recovery capabilities of OceanBase AI Database, including same-city single-IDC deployment (two replicas for compute nodes and three replicas for LogService), same-city single-IDC deployment (one replica for compute nodes and three replicas for LogService), same-city multi-IDC deployment (two replicas for compute nodes and three replicas for LogService), and same-city triple-IDC deployment (three replicas for LogService). OceanBase AI Database allows you to flexibly adjust the cluster deployment architecture to adapt to the technical evolution of business scenarios.
The flexible deployment architecture of OceanBase AI Database relies on the Locality attribute. In addition to describing the replica type, Locality also describes the distribution strategy of replicas across zones. A zone has a region attribute, which describes the geographic distribution of the zone and can be queried from the REGION column in the oceanbase.DBA_OB_ZONES view. You can adjust the distribution of multiple replicas of a tenant across zones in different regions to achieve flexible deployment modes.
OceanBase AI Database supports two typical deployment modes for compute nodes: single replica and two replicas. The following table describes the Locality settings in different deployment modes.
Deployment mode |
Locality |
Zone distribution |
|---|---|---|
| Single replica | F@z1 |
Zone z1 is located in IDC 1 in Region R1. |
| Two replicas | F@z1,F@z2 |
Zones z1 and z2 are located in IDC 1 in Region R1. |