All Products
Search
Document Center

Tablestore:Add replicas to a global table

Last Updated:Jun 01, 2026

Adds one or more replicas to an existing global table using the Tablestore Java SDK.

Usage notes

The bind operation is asynchronous. After the call succeeds, the system syncs data to the new replicas in the background. Call DescribeGlobalTable to check progress — the replica is ready when its status returns active.

Prerequisites

Before you begin, ensure that you have:

Method

public BindGlobalTableResponse bindGlobalTable(BindGlobalTableRequest request) throws TableStoreException, ClientException

BindGlobalTableRequest parameters

  • globalTableId String: The global table ID.

    Note

    To get the global table ID, call DescribeTable to query the replica details. If the table replica belongs to a global table, the response includes the corresponding global table ID.

  • globalTableName String: The global table name. Must match the base table name.

  • placements List<Placement>: The replicas to add. Each entry configures one replica:

    Parameter

    Type

    Description

    regionId

    String

    The region where the replica is deployed.

    instanceName

    String

    The instance name for the replica.

    writable

    boolean

    Whether the replica accepts writes. Default: false. Set to true for multi-active mode replicas; keep false for active-passive mode.

Example

The following example adds two replicas to an existing global table — one in China (Hangzhou) in active-passive mode and one in China (Shanghai) in multi-active mode.

private static void bindGlobalTableExample(SyncClient client) {
    BindGlobalTableRequest request = new BindGlobalTableRequest(
            "gt-ee1b54db-f5d9-43f3-ad36-ec44********",
            "my-global-table"
    );

    List<GlobalTableTypes.Placement> placements = new ArrayList<>();

    // Active-passive mode: read-only replica, writable = false
    GlobalTableTypes.Placement hangzhouReplica = new GlobalTableTypes.Placement(
            "cn-hangzhou",
            "instance-replica-hz",
            false
    );

    // Multi-active mode: read/write replica, writable = true
    GlobalTableTypes.Placement shanghaiReplica = new GlobalTableTypes.Placement(
            "cn-shanghai",
            "instance-replica-sh",
            true
    );

    placements.add(hangzhouReplica);
    placements.add(shanghaiReplica);
    request.setPlacements(placements);

    BindGlobalTableResponse response = client.bindGlobalTable(request);
    System.out.println("Bind succeeded. Request ID: " + response.getRequestId());
}