This topic was translated by AI and is currently in queue for revision by our editors. Alibaba Cloud does not guarantee the accuracy of AI-translated content. Request expedited revision

Adjust the number of shards for an instance

Updated at: 2025-03-05 03:18
important

This topic contains important information on necessary precautions. We recommend that you read this topic carefully before proceeding.

When data scale increases or read and write traffic surges, Tair (Redis OSS-compatible) cloud-native instances with cluster architecture support flexible adjustment of shard nodes and seamless scaling without transient connection or read-only status. After increasing or decreasing the number of shards, the instance automatically redistributes data to maintain consistency. This feature enables flexible management of read and write hot spots and data skew.

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 changes.

Impacts

  • Setting shard addition or removal to occur during the maintenance window is not supported. Once the shard adjustment operation is complete, the instance status changes to Changing Configuration.

  • The time it takes to complete configuration changes depends on factors such as network conditions, task queue length, instance payload, and data volume. Since configuration changes may cause fluctuations in response latency, it is advisable to perform them during off-peak business hours.

  • Be aware that removing shards will decrease the overall capacity and performance of the instance, and will forcibly disconnect connections on the affected shards. Exercise caution with this operation, and ensure that the application is capable of automatically reestablishing connections.

Precautions

  • The minimum number of shards for an instance is 2. You can add or remove up to 64 shards at a time, with a maximum of 256 shards per instance.

  • When adding shards, the instance automatically redistributes data. However, adding just a few shards at a time can result in slow data redistribution and reduced scale-out efficiency. It is recommended to add at least one-sixth of the current total number of shards (rounded up) to an instance at once, for example:

    • If your instance contains 8 shards, it is advisable to add at least 2 shards (since 8 divided by 6 equals 1.33, which rounds up to 2).

    • For an instance with 64 shards, adding at least 11 shards is recommended.

    • For an instance comprising 100 shards, we recommend the addition of at least 17 shards.

Procedure

  1. Log on to the 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 area, select one of the following operations based on your business needs:

    • To add shards

      Click Add Shard, enter the number of shards in the pop-up box, click Proceed To Payment, and follow the prompts to complete the payment.

      Note

      The specifications of the added shards will match those of existing shards and cannot be altered.

    • Remove shards.

      Warning

      Be aware that removing shards will decrease the overall capacity and performance of the instance, and will forcibly disconnect connections on the affected shards. Exercise caution with this operation, and ensure that the application is capable of automatically reestablishing connections.

      1. Click Batch Delete or Delete next to the corresponding shard ID.

      2. In the dialog box, choose the deletion policy for the Proxy node: Execute Immediately or Execute During Maintenance Window, which has a lower impact.

      3. Click OK. The shard will be removed instantly, and its data will be automatically redistributed to other shards.

FAQ

Will data be lost if shards are removed?

No data is lost when shards are removed. The data is redistributed.

Will a refund be issued if shards are removed?

A refund is automatically processed when shards are removed. For detailed fee descriptions and refund policies, see configuration change fee description.

Will data be redistributed if the number of shards in an instance is increased or decreased?

Data is automatically analyzed and redistributed when the number of shards in an instance changes. The instance is optimized at the kernel layer for efficient data redistribution, minimizing business impact.

Related API

API Interface

Description

API Interface

Description

AddShardingNode

Adds shards to a cluster instance.

DeleteShardingNode

Removes shards from a cluster instance.

References

  • The Redis open source edition automatically adds shards based on the average memory utilization of the instance to ensure the safety and stability of the service. For more information, see how to automatically add shards.

  • To modify the shard count of a classic edition cluster architecture instance, see changing instance configuration.

  • On this page (1, M)
  • Prerequisites
  • Billing
  • Impacts
  • Precautions
  • Procedure
  • FAQ
  • Will data be lost if shards are removed?
  • Will a refund be issued if shards are removed?
  • Will data be redistributed if the number of shards in an instance is increased or decreased?
  • Related API
  • References
Feedback
phone Contact Us

Chat now with Alibaba Cloud Customer Service to assist you in finding the right products and services to meet your needs.

alicare alicarealicarealicare