For cross-region services that require low-latency access and high availability, use the Global Table feature. It automatically synchronizes data across multiple regions for cross-region disaster recovery, supporting local read/write operations and failovers.
How it works
A Global Table uses the multi-region replication technology of Tablestore to establish data synchronization channels between instances in multiple regions. When data in a table in one region changes, the change is automatically synchronized to its replica tables in other regions, ensuring cross-region data consistency. You can dynamically add or remove replica tables in different instances and regions.
The replication process runs automatically in the background. This mechanism achieves an acceptable recovery point objective (RPO) while ensuring data consistency, meeting the disaster recovery and business continuity needs of most business systems.
Users and applications can read from and write to the nearest replica, significantly reducing access latency. If a region fails, you can quickly fail over to another replica. This helps you restore critical applications and data, ensuring business continuity.

Features
| Cross-region disaster recovery If one region fails, replicas in other regions continue to provide service. |
| Low-latency access Accessing the nearest replica reduces read and write latency. | ||
| Eventual consistency Data is synchronized asynchronously between replicas, achieving eventual consistency. |
| Automatic conflict resolution The system uses the last-writer-wins (LWW) algorithm to automatically resolve concurrent write conflicts from multiple regions. |
Use cases
Global Tables are suitable for business scenarios that require high availability, low-latency cross-region reads and writes, and cross-region disaster recovery. Typical use cases include:
Cross-region backup: If the primary region fails, you can switch to the secondary region to continue providing read services and ensure business continuity. For example, an e-commerce system stores its primary user table in a Tablestore instance in the China (Hangzhou) region and a passive table in the China (Beijing) region. If the China (Hangzhou) region fails, the instance in China (Beijing) continues to provide query services.
Write in one region, read from multiple regions: Write data to the nearest region and read it from other nearby regions. This is ideal for accelerating remote access. For example, an application's primary writes are directed to the China (Hangzhou) region, while read-only replicas are deployed in the China (Beijing) and China (Shanghai) regions to meet the demand for low-latency cross-region reads.
Write to multiple regions, read globally: Writing to multiple regions creates a global dataset. This dataset provides eventually consistent reads and is ideal for scenarios that require access to a global dataset. Examples include globally distributed applications such as gaming profiles and social messaging systems.
Supported regions for Global Table: This feature is supported in the China (Hangzhou), China (Shanghai), China (Qingdao), China (Beijing), China (Zhangjiakou), China (Hohhot), China (Ulanqab), China (Shenzhen), China (Guangzhou), and China (Chengdu) regions.
Create a global table
First, activate the service and create an instance. Create instances in both the primary region and the target replica regions.
Step 1: Prepare the base table
In the primary region, create a data table to serve as the base for the Global Table.
If you use an existing data table as the base table for a Global Table, ensure that the table meets the following configuration requirements: The time to live is set to -1, max versions is set to 1, max version offset is set to MaxInt32 (2147483647), and it is a row mode table.
You cannot use an existing table to create a Global Table if it is not a row mode table. To use such a table, contact technical support to enable this feature.
Go to the Instance Management page.
Log on to the Tablestore console.
In the top navigation bar, select a resource group and a region.
On the Overview page, click an instance alias or click Manage Instance in the Actions column of the instance.
On the Instance Details tab, click Create Table.
In the Create Table dialog box, set Data Table Name and Primary Key.
Turn on the Advanced Settings switch, and then the Quick Set Global Table Dependency switch. The system automatically configures the dependencies for the Global Table.
Parameter
Value
Description
Time to live
-1
Data never expires.
Max versions
1
The maximum number of versions is 1.
Support row version
On
Enables row mode for the table.
NoteYou cannot turn off Enable Row Versioning after you turn it on. After you enable row versioning, the following limitations apply:
A single row can have a maximum of 256 columns.
You cannot manually specify a version number when you write data. The system generates it automatically.
When you perform an Update operation, the system must first read the current row version. This results in a small amount of additional read load.
Max version offset
MaxInt32 (2147483647)
Set the version offset to the maximum Int32 value. This means there is no limit.
For Data Table Name, enter
exampletable. In the Primary Key section, add two primary keys. Set the name of the first primary key touser_idand the type to String, and set it as the partition key. Set the name of the second primary key toregion_idand the type to String. Click Create.Click Create.
Step 2: Create the global table
Convert the base table into a Global Table and add replica regions. After the Global Table is created, the system automatically creates corresponding data tables in the selected replica regions and establishes data synchronization channels.
In the primary region, on the Tables tab, click Create Global Table in the Actions column of the base table.
NoteYou can also click the data table name, go to the Global Table tab, and click Create Sync Relationship to proceed.
In the Create Global Table dialog box, set the parameters for the Global Table.
NoteIf a data table with the same name as the Global Table already exists in the destination instance, the creation fails.
Active-passive mode
In the Current Resource area, set Global Sync Mode to Primary/Standby Mode (Cross-Region Replication).
In the Target Table area, select the region and instance name of the destination instance.
You can add multiple destination instances at once. After you create the Global Table, the system automatically creates target tables in the instances of the selected regions. The target table names are the same as the current base table name.
The read/write permission for the destination instance is Read-only.
Active-active mode
In the Current Resource area, set Global Sync Mode to Multi-Read Multi-Write (Cross-Region Replication).
In the Target Table area, select the region, instance name, and read/write mode for the destination instance.
You can add multiple destination instances at once. After you create the Global Table, the system automatically creates target tables in the instances of the selected regions. The target table names are the same as the current base table name.
Click OK.
In the Create Global Table dialog box, click View List. You can view the Global Table on the Global Table tab.
Step 3: Verify the global table
After the Global Table is created, verify the data synchronization and perform basic read and write tests.
Write test data: Write test data to the data table in the primary region.
In the primary region, on the Tables tab, click Query in the Actions column of the base table.
On the Query Data tab, click Insert.
In the Insert dialog box, set the primary keys, click Add Column to add an attribute, and then click OK.
Verify data synchronization: Wait 1 to 3 seconds, then query the data in a replica region to verify synchronization.
In the primary region, on the Tables tab, click Query in the Actions column of the base table.
On the Global Table tab of the base table, click the name of a replica table in a replica region.
On the Query Data tab of the replica table, you can view the data synchronized from the base table in the primary region.
Global table reads and writes
Reading from and writing to the replica tables of a Global Table is the same as reading data from and writing data to a standard data table.
To read data, get the endpoint of the instance where the corresponding replica table is located.
In active-passive mode, only the primary replica allows writes through its instance endpoint. All other replicas are read-only, except during an active-passive switchover. In active-active mode, all writable replicas allow writes through their respective instance endpoints.
ImportantIn active-active mode or during an active-passive switchover, a replicated write can conflict with a user-initiated write on the same row. The system resolves this conflict using a last-write-wins (LWW) approach: the write with the higher version number succeeds, and the data from the other write is lost.
Manage active-passive mode
Modify the active-passive relationship
This feature is available only for Global Tables in active-passive mode.
In active-active mode or during an active-passive switchover, a replicated write can conflict with a user-initiated write on the same row. The system resolves this conflict using a last-write-wins (LWW) approach: the write with the higher version number succeeds, and the data from the other write is lost.
In active-passive mode, if the primary replica table fails or the application layer needs to switch the write region, you can set another replica table as the new primary replica to continue providing services.
On the Global Table tab, click Switch to Primary Table in the Actions column of the passive table.
In the Modify Primary/Standby Relationship dialog box, submit the primary table switchover task and start data synchronization.
ImportantData synchronization is an ongoing process, and its duration depends on factors such as data volume and system resources. During synchronization, both the current primary replica and the new primary candidate are writable, creating a risk of data inconsistency.
In the Data Synchronization step, click Start Data Synchronization.
In the Primary/Standby Table Switch dialog box, click View Details to check the RPO status of the data synchronization.
Switch the application layer write path.
Confirm that the data in the primary and passive tables is consistent before you switch the application layer write path.
Click Confirm Write Endpoint Switch in the Sync Mode column of any table.
In the Application Layer Write Path Switch step, confirm that data synchronization is complete and that you have changed all write endpoints in your application to the new primary's endpoint. Then, click Complete Switch.
Confirm the switch to the primary table.
After switching the write path, confirm the primary table switch as soon as possible.
ImportantAfter this operation, the write capability of the original primary table will be disabled.
Click View in the Sync Mode column of any table.
In the Confirm Switch step, click Switch Primary Table.
NoteTo cancel the active-passive table switchover, click Cancel Primary Table Switch and complete the cancellation confirmation.
In the confirmation dialog box, click OK.
After the switch is successful, the original primary replica becomes read-only, and the new primary replica provides read and write capabilities.
Add a global region
Add one or more global regions to a Global Table.
On the Global Table tab, click Add Global Region in the Actions column of a replica table.
In the Add Global Region dialog box, select the region and instance name of the destination instance.
To add multiple global regions, click Add Instance and continue.
NoteIf a data table with the same name as the Global Table already exists in the destination instance, adding the global region will fail.
Click OK.
Remove synchronization relationship
Remove the synchronization relationship for a Global Table.
To stop synchronization for all regions of a Global Table, you must remove the synchronization relationship for each replica table separately. You must remove the passive tables first, and then the primary replica. To remove the synchronization for a specific region, perform the operation only on the replica table for that region.
On the Global Table tab, choose one of the following methods to start removing the synchronization relationship.
Remove a single replica: Click Remove Sync in the Actions column of the replica table.
Remove multiple replicas in a batch: Select the replica tables to be removed, and click Remove Sync below the list.
In the confirmation dialog box, click OK.
The system starts to remove the synchronization relationship. Please wait for the process to complete.
Manage active-active mode
Edit target instances
On the Global Table tab, click Edit in the Actions column of a replica table.
In the Edit Global Table dialog box, perform the desired operation.
Add a target instance: Select the region, instance name, and read/write mode for the destination instance.
To add multiple global regions, click Add Instance and continue.
NoteIf a data table with the same name as the Global Table already exists in the destination instance, adding the global region will fail.
Modify the read/write mode of an instance: Select the new read/write mode for an existing instance.
Click OK.
Remove synchronization relationship
Remove the synchronization relationship for a Global Table.
To stop synchronization for all regions of a Global Table, you must remove the synchronization relationship for each replica table separately. To remove the synchronization for a specific region, perform the operation only on the replica table for that region.
On the Global Table tab, click Unsync in the Actions column of a replica table.
In the confirmation dialog box, click OK.
The system starts to remove the synchronization relationship. Please wait for the process to complete.
Developer integration
You can use Global Tables with the Java SDK.
Production use
Recommendations for Global Table operations
Create a Global Table for an existing table: The original read and write APIs remain unchanged. Data is automatically synchronized to the new replica, which can share the read load.
Create a new Global Table from scratch: Finalize the table schema, create the base table, and then create the Global Table. You cannot modify the schema of a Global Table. Make sure the base table passes all tests before you create the Global Table.
Dynamically add a new replica: While using a Global Table, you can dynamically add new replicas without affecting the read and write operations of existing replicas. The new replica will contain the latest data from the Global Table.
Remove existing replicas: If a replica table is no longer needed, you can first remove its synchronization relationship. After this operation, the replica no longer synchronizes data from other replicas, but the table and its data are retained. To delete the replica table, you must manually delete it after its synchronization is removed.
Choose a suitable combination of regions: Select appropriate primary and backup regions based on user distribution and business needs.
Primary region failover: In active-passive mode, if the primary region becomes unavailable, you can first select a new primary replica in the console and then redirect your application's write traffic. After the data synchronizes, complete the switchover in the console. A brief write interruption may occur during the switchover. We recommend that you implement a retry mechanism in your application.
ImportantYour application should manage the order and timing of application and service switchovers to prevent data loss.
Quotas and limits
For more information, see Global Table limits.
Table type limitations: Only data tables are supported. Cross-region synchronization is not supported for time-series tables, search indexes, or secondary indexes.
Number of replicas: A single Global Table can have replicas in up to 10 regions.
Synchronization latency: The synchronization RPO is typically within a few seconds. The actual latency depends on the regions, network conditions, and data volume.
Risk of data overwrites: In active-active mode or during an active-passive switchover, a replicated write can conflict with a user-initiated write on the same row. The system resolves this conflict using a last-write-wins (LWW) approach: the write with the higher version number succeeds, and the data from the other write is lost.
Unsupported features:
Reliability guarantees for data transmission latency, such as Real-time Communication (RTC), are not provided.
You cannot modify the properties of a Global Table, such as changing the time to live (TTL) configuration or adding predefined columns.
Existing data tables are created in column mode by default and cannot be directly upgraded to a Global Table.
When you reuse a table that was previously part of a Global Table, you cannot re-establish the synchronization relationship. You must first delete its associated search indexes and secondary indexes, delete the table itself, and then create a new Global Table.
NoteThis scenario applies when you want to make a table part of a Global Table again after its synchronization relationship has been removed.
Billing
Global tables incur fees for data storage, data reads, data writes, and cross-region replication traffic.
The billing method for data storage and read/write operations on each replica table is the same as that of a standard data table. For more information, see Billing overview.
The following fees apply:
-
Data storage fee: Each replica table stores data independently. You are billed separately for the actual amount of data stored in each table's region.
-
Data read fee: Covers local read operations on all replica tables.
-
Data write fee: Write operations can be performed only on writable replicas. Write fees are incurred only on the table to which data is directly written. Replica tables that synchronize data through asynchronous replication do not incur write fees.
-
Cross-region replication traffic fee: Charged for the cross-region data transfer traffic generated when data is asynchronously replicated to each replica table.
ImportantThe cross-region replication traffic fee for each replica is calculated separately. The fee is charged to the instance from which the data is pulled.
FAQ
Modify global table configuration
You cannot directly modify the configuration of a Global Table. To make changes, you must dissolve the existing Global Table and create a new one. To avoid data loss, first direct all read and write operations to the single table you intend to keep as the new base. Then, remove the synchronization relationships for all other replica tables and modify the base table before recreating the Global Table.
How do I delete a replica table?
First, remove the synchronization relationship of the replica table from the Global Table. After the operation is successful, delete the replica table from the table list of the instance in the console.
Read from passive replicas
In the primary instance, on the Global Table tab of the base table, find the instance name of the associated replica table. Then, use the endpoint of that instance to read the data.
Cross-region update consistency
The row data is eventually consistent. The final state of the row is determined by the state of the replica at the time of the last write ('b'). This can result in two possible outcomes:
If the replica had not yet synchronized update 'a' when update 'b' was written, the final row will contain the data from update 'b' but not from update 'a'.
If the replica had already synchronized update 'a' when update 'b' was written, the final row will contain the data from both update 'a' and update 'b'.
Create global tables across countries?
Due to data compliance and other regulations, creating Global Tables across different countries is not currently supported. For a list of supported regions for Global Tables, see Feature and region support list.



