Use Global Tables for services that span multiple regions and require low-latency access and high availability. Global Tables automatically synchronize data across regions to enable cross-region disaster recovery. This feature supports nearest region reads and writes, and disaster recovery switchovers.
How it works
Global Tables use Tablestore's multi-region replication technology to create data synchronization channels between instances in different regions. When data in a table in one region changes, the change is automatically synchronized to replica tables in other regions. This process ensures cross-region data consistency. You can dynamically add or remove table replicas across different instances and regions.
The entire replication process runs automatically in the background without manual intervention. This mechanism achieves an acceptable recovery point objective (RPO) while ensuring data consistency. It effectively meets the disaster recovery and business continuity requirements of most business systems.
For daily use, users or applications can access the nearest replica for read and write operations. This significantly reduces access latency. In the event of a regional failure or a major disaster, such as a data center outage or natural disaster, you can quickly initiate a disaster recovery switchover using the multiple replicas. This helps you rebuild critical applications and data, ensuring business continuity.
Features
| Multi-region disaster recovery Table replicas are spread across regions. If a regional failure occurs, replicas in other regions can continue to provide services. |
| Low-latency access Users or applications can read and write data on the nearest replica. This greatly reduces operation latency. | ||
| Eventual data consistency Global Tables use an eventual consistency model. Data is synchronized asynchronously between multiple replicas to achieve eventual consistency. |
| Automatic conflict resolution The system automatically handles concurrent write conflicts from multiple locations using the Last Write Win (LLW) algorithm. |
Scenarios
Global Tables are suitable for business scenarios that require high availability, low-latency cross-region reads and writes, and cross-region disaster recovery. Typical scenarios are as follows:
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 tables in a Tablestore instance in the China (Hangzhou) region and a replica 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 in multiple regions: Write data to the nearest region and read it from other nearby regions. This is suitable for scenarios that require accelerated remote access. For example, the primary write operations for a service are directed to the China (Hangzhou) region. Read-only replicas are deployed in the China (Beijing) and China (Ulanqab) regions to meet the demand for low-latency cross-region reads.
Global Table region support: Global Tables are currently 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
Activate the service and create an instance. Create instances in both the primary region and the target replica region.
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 want to use an existing data table as the base table for a global table, make sure the table meets the following configuration requirements: time to live (TTL) is -1, max versions is 1, the max version offset is set to MaxInt32 (2147483647), and the table is a row mode table.
Existing tables that are not in row mode do not support the creation of global tables. To use such a table, contact technical support to enable this feature.
Go to the Instance Management page.
Log on to the Tablestore console.
At the top of the page, select a resource group and region.
On the Overview page, click the alias of an instance or click Instance Management in the Actions column of the instance.
On the Instance Details tab, click Create Data Table.
In the Create Data Table dialog box, set Data Table Name and Primary Key.
Turn on the Advanced Settings switch, and then turn on the Quickly set dependencies for global tables switch. The system automatically configures the dependencies for the global table.
Parameter
Required value for global tables
Description
Data lifecycle
-1
Data never expires.
Max versions
1
The maximum number of versions is 1.
Row versioning support
Enabled
Set the table to row mode.
NoteYou cannot disable Enable row versions after you enable it. After you enable row versions, the following limits apply:
A single row can have a maximum of 256 columns.
You cannot manually specify a version number when writing data. The system must generate 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.

Click Create.
Step 2: Create the global table
Convert the base table into a global table and add replica regions. After creation, the system automatically creates corresponding data tables in the selected replica regions and establishes data synchronization channels.
In the primary region, on the Data Table List 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 Global Table Synchronization Relationship to proceed.
In the Create Global Table dialog box, configure the current resource.
Select the data table.
Set Global Synchronization Mode to Active-passive mode (cross-region replication).

In the Target Table area, select the region and instance name of the destination instance.
The system supports adding 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.
NoteIf a data table with the same name as the global table already exists in the destination instance, the global table creation will fail.
Click OK.
In the Create Global Table dialog box, click View in List. You can view the global table on the Global Table tab.

Step 3: Verify and use the global table
After creation, verify the data synchronization feature 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 Data Table List tab, click Query/Search in the Actions column of the base table.
On the Data Management tab, click Insert Data.
In the Insert Data dialog box, set the primary key, click Add Attribute Column to add an attribute, and then click OK.
Verify data synchronization: Wait 1 to 3 seconds, then query the data in the replica region to verify the synchronization.
In the primary region, on the Data Table List tab, click Query/Search in the Actions column of the base table.
On the Global Table tab of the base table, click the name of the replica table in the replica region.
On the Data Management tab of the replica table, you can view the data that was synchronized from the base table in the primary region.
Read and write data in a global table
Reading and writing data in the replica tables of a global table is the same as reading data and writing data in a standard data table.
To read data, use the Endpoint of the instance where the corresponding replica table is located.
In active-passive mode, only the primary replica allows writes through the Endpoint of its instance. Other replicas are read-only, except during an active-passive switchover.
Modify the active-passive relationship
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 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 Active-Passive Relationship dialog box, submit the primary table switchover task and start data synchronization.
ImportantData synchronization will continue. The duration depends on the data volume, system resources, and other factors. During data synchronization, both the primary replica table and the replica table selected as the new primary are writable. This may pose a risk of data inconsistency.
In the Data Synchronization step, click Start Data Synchronization.

In the Active-Passive Table Switchover 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 switching the application layer write path.
Click Confirm Write Path Switch in the Synchronization 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 Write Path Switched.

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 Synchronization Mode column of any table.
In the Confirm Switch to Primary Table step, click Synchronization Complete, Switch to Primary Table Now.
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 modification is successful, the original primary replica will become read-only, and the new primary replica will provide 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 the 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
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 table. To remove the synchronization relationship for a specific region, remove only 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 Synchronization in the Actions column of the replica table.
Remove multiple replicas in a batch: Select the replica tables to be removed, and click Remove Synchronization below the list.
In the confirmation dialog box, click OK.
Developer integration
You can use global tables with the Java SDK.
Going live
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. The new replica can share the read load.
Create a new global table from scratch: Determine the table schema, create the base table, and then create the global table. Global tables do not support modifying the table schema. Make sure the base table passes all tests before creating the global table.
Dynamically attach 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 have the latest data from the global table.
Detach existing replicas: If a replica table is no longer needed, you can detach it first. After detaching, the replica will no longer synchronize data from other replicas, but the table and its data are retained. To delete the replica, you must manually delete it after detaching it.
Choose a reasonable region combination: Select appropriate primary and secondary 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 table in the console, then switch the application's write path. Wait for the data to synchronize to the new primary replica table, and then promote it to the primary replica table. There may be a brief write interruption during the switchover. We recommend implementing a retry mechanism on the business side.
ImportantYour business 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 limits: 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 supports a maximum of 10 regions.
Synchronization latency: The synchronization RPO is typically within a few seconds. The actual latency depends on the region, network conditions, and data volume.
Unsupported features:
Reliability guarantees for data transmission latency, such as Real-time Communication (RTC), are not provided.
Global tables do not support modifying table properties, such as changing the TTL configuration or adding predefined columns.
Existing data tables are created in column mode by default and cannot be directly upgraded to global tables.
You cannot re-associate a synchronization relationship for a data table that was previously part of a global table. To use this table in a new global table, 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 a data table that was once part of a global table has its synchronization removed and you want to use it to create a global table again.
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 fees are described as follows:
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: This fee is for 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: This fee is charged for the cross-region data transfer traffic that is 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
How do I modify the configuration of a global table, such as setting the TTL or adding a custom column?
You cannot directly modify the configuration of a global table. To make changes, you must first detach all replicas, modify the base table, and then recreate the global table. Before you recreate the global table, direct all read and write operations to the primary replica to avoid affecting your application. Then, delete the other replicas.
How do I delete a replica table?
First, detach the replica table from the global table. After the detachment is successful, delete the replica table from the table list of the instance in the console.
In active-passive mode, how do I read data from a replica table in a non-primary instance?
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.
In row mode, if I use the UpdateRow API to update different columns of the same row in different regions sequentially (assume 'a' is updated first, then 'b'), what will the row data look like?
The data row is eventually consistent. The final value is the entire row from the replica where b is located. The specific data can be one of the following two cases:
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'.
Can I create a global table between regions in different countries?
Due to data compliance and other reasons, 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.



