All Products
Search
Document Center

Tair:Adjust the number of data shards for an instance

Last Updated:Mar 04, 2024

Tair cloud disk-based cluster instances allow you to adjust the number of shards to handle sudden spikes in database traffic. These instances also support imperceptible scaling, during which the instances continue to handle both read and write operations without transient connections. After the number of shards in a cluster instance is increased or decreased, the instance evenly redistributes data across available shards to ensure data consistency. You can use these features to flexibly handle reads and writes on hot data and data skews.

Prerequisites

Billing

  • If you change the number of shards for a pay-as-you-go instance, you are charged based on the new specifications after the change. In this case, no upfront payment is required. You only need to make a payment upon receiving the bill.

  • If you add shards to a subscription instance, you must pay for the cost of the additional shards. If you remove shards, a refund for the removed shards is automatically issued. For information about the fees and refund policy, see Configuration change.

Impacts

  • You cannot add or remove shards during the maintenance window. After you adjust the number of shards for an instance, the status of the instance changes to Changing Configuration.

  • The time required to complete a configuration change depends on factors such as the network conditions, task queue length, instance load, and data volume. The configuration change may cause fluctuations in response latency. We recommend that you perform the operation during off-peak hours.

  • After you remove data shards from a cluster instance, the total storage capacity and performance of the instance decrease, and your application is disconnected from the data shards. Proceed with caution. To perform this operation, make sure that the application can automatically reconnect to the instance.

Limits

The instance can contain 2 to 256 data shards. You can add or remove up to 64 data shards at a time.

Procedure

  1. Log on to the Tair console and go to the Instances page. In the top navigation bar, select the region in which the instance that you want to manage resides. Then, find the instance and click the instance ID.

  2. In the Shard Information section, perform the following operations based on your business requirements:

    • Add data shards

      Click Add Shard. In the panel that appears, specify the number of shards. Click Pay and complete the payment.

      Note

      The specifications of the data shards to be added are the same as those of existing data shards and cannot be modified.

    • Remove data shards

      Warning

      After you remove data shards from a cluster instance, the total storage capacity and performance of the instance decrease, and your application is disconnected from the data shards. Proceed with caution. To perform this operation, make sure that the application can automatically reconnect to the instance.

      Find the data shard that you want to remove and click Delete in the Actions column. You can also click Delete Shard to batch remove data shards.

FAQ

Does data loss occur if I remove shards from a cluster instance?

If you remove shards from a cluster instance, data is not lost. The data is redistributed across available shards.

Is a refund issued if I remove shards from a cluster instance?

If you remove shards from a cluster instance, a refund is automatically issued. For more information about fees and refunds, see Configuration change .

Is data redistributed after I increase or decrease the number of shards in a cluster instance?

After the number of shards changes in a cluster instance, the instance analyzes the distribution of data in the instance and evenly redistributes data across the shards. Tair optimizes data redistribution at the engine layer to accelerate redistribution and reduce business impacts.

Related API operations

API operation

Description

AddShardingNode

Adds data shards to a cluster instance of ApsaraDB for Redis Enhanced Edition (Tair).

DeleteShardingNode

Removes data shards from a cluster instance of ApsaraDB for Redis Enhanced Edition (Tair).

References

For information about how to adjust the number of shards for ApsaraDB for Redis Enhanced Edition (Tair) local disk-based instances, see Change the configurations of an instance.