Comparing Synchronization Items
This section describes how to compare synchronization items to check if there are any differences between source and destination databases. By comparing object-level or data-level objects, you can determine the proper time for service migration to minimize the service downtime.
- Object-level comparison: compares databases, indexes, tables, and views.
- Data-level comparison: compares rows and values of tables.
Prerequisites
You have logged in to the DRS console.
Procedure
- On the Data Synchronization Management page, click the target synchronization task name in the Task Name/ID column.
- Click the Synchronization Comparison tab.
- On the Synchronization Comparison page, click Object-Level Comparison and click Compare. Wait for a while and click
to check whether the comparison results of the source and destination databases are consistent. Locate a comparison item you want to view and click View Details in the Operation column. Figure 1 Object-level comparison
- After the object-level comparison is complete,click the Data-Level Comparison tab.
- Click Create Comparison Task. In the displayed Create Comparison Task dialog box, specify Comparison Type, Compute Resource, Comparison Time, and Object. Then, click OK. Figure 2 Creating a comparison task
- Comparison Type: compares rows and values.
- Compute Resource: This function affects the resources used by value comparison on the source database. Compute resources are classified into DRS compute resources and database compute resources.
- On DRS: DRS reads data from both the source and destination databases first and then compares the data, which increases the I/O read load on the source database but does not affect the performance of source CPU and memory. This option is suitable for value comparison of cold data in static tables during service running.
- On databases: DRS directly compares data on the source and destination databases using their own CPU, memory, and I/O resources. This option is suitable for value comparison in non-service window when no data changes occur. The comparison on database is faster than the comparison on DRS.
- Comparison Time: You can select Start upon task creation or Start at a specified time. There is a slight difference in time between the source and destination databases during synchronization. Data consistency may occur. You are advised to compare migration items during off-peak hours for more accurate results.
- Object: You can select objects to be compared based on the scenarios.
- Currently, only the MySQL to MySQL data synchronization supports value comparison.
- Full synchronization tasks do not support data-level comparisons.
- Currently, only the MySQL engine supports compute resource selection.
- After the comparison creation task is submitted, the Data-Level Comparison tab is displayed. Click
to refresh the list and view the comparison result of the specified comparison type. Figure 3 Data-level comparison
Currently, the value comparison function only applies to tables with one column with a primary key or unique index. You can use the row comparison function for tables that do not support value comparison. Therefore, you can compare data by row or value based on scenarios.
If you want to view the row or value comparison details, click View Results.
Figure 4 Viewing data-level comparison details
You can also view comparison details of canceled comparison tasks.
Last Article: Viewing Synchronization Logs
Next Article: Data Subscription
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.