Help Center/ Data Replication Service/ FAQs/ Product Consulting/ Why Is the Database Disk Usage Inconsistent Before and After Data Migration?
Updated on 2024-11-30 GMT+08:00

Why Is the Database Disk Usage Inconsistent Before and After Data Migration?

Possible Causes

  • Cause 1: During a full migration, DRS uses row-level parallel migration to ensure migration performance and transmission stability. If the source database data is compact, there may be table bloat after data is migrated to the cloud. As a result, the disk space required is much greater than that of the source database.
    For details about the sequential insertion principle in parallel, see Figure 1.
    Figure 1 Sequential insertion

    If data is inserted in a non-sequential manner after parallel execution, as shown in Figure 2, and data 4 is inserted at last, leaf nodes 3 and 5 are split, and the split leaf nodes have free disk space.

    Figure 2 Non-sequential insertion after parallel execution
  • Cause 2: When Binlog is enabled for the destination database, Binlog files are generated on the destination database when data is written in the full phase, occupying some disk space. As a result, the disk space usage of the destination database is greater than that of the source database.

Solution

You cannot determine whether data is consistent before and after the migration based on the used disk space. You can use Data Comparison to check whether data is consistent before and after the migration.