Doubling Shards and Resharding Data Records
Overview
The other method is resharding, with which, physical databases corresponding to the schema are doubled and rebalanced to each DB instance as much as possible. During this process, data records are redistributed.
Prerequisites
- There are schemas available in a running DDM instance.
- You have purchased a MySQL DB instance. The DB instance and your DDM instance are in the same VPC, and the DB instance is not in use by other DDM instances.
Procedure
- In the instance list, locate the instance that contains schemas you require and click the instance name.
- On the displayed page, in the navigation pane, choose Schemas.
- In the schema list, locate the schema that you want to scale out and click Scale Out the Operation column. Figure 1 Scale Out
- On the displayed page, select Reshard for Scaling Method and the DB instances you want to add, enter the required password, and click Next: Confirm Information. Figure 2 Reshard
Figure 3 How resharding works
- Click Next: Pre-check. After all check items are complete, click Scale out.
If the DDM instance version is earlier than 2.4.1.3, do not set sql_mode to ANSI_QUOTES. If you do so, do not use double quotation marks to quote text strings because the quotation marks will be translated into an identifier that makes the quoted string invalid.
For example, in the command select * from test where tb = "logic", logic cannot be parsed correctly.
- If the schema status changes to Running, the scaling out succeeds, and the newly-added MySQL DB instance is displayed in the Associated DB Instance column.
If the schema status changes to Scaling failed, the schema failed to be scaled out. Click Retry or Roll Back.
- Scale out a schema during off-peak hours.
- Storage scaling does not support tables without primary keys.
- Only schemas whose status is Running can be scaled out.
- Only one schema can be scaled out in a DDM instance at a time.
- A maximum of 256 MySQL DB instances can be selected for scaling.
- You can view the scaling progress on the Schemas page. The whole scaling process takes about 5 to 30 minutes depending on the amount of data to be migrated.
- During scaling, DDM automatically enables the LOAD DATA function. After scaling, you can disable the function in parameter template settings of the MySQL DB instance as needed.
Last Article: Rebalancing Shards
Next Article: Data Management
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.