data Compare is a Java-based tool for validating data consistency after replication or migration between databases. It's designed for scenarios like:
-
Data migration from Oracle/DB2/MariaDB/MySQL/MSSQL to Postgres: Compare data post-migration.
-
Logical replication between same or different database platforms: Validate data across platforms while minimizing database overhead.
-
Active-Active replication configuration: Regularly verify data consistency to mitigate risks.
DataCompare uses hashing to compare table data efficiently. Hash values for primary keys and remaining columns are stored in a repository, reducing storage and network demands. Comparisons are processed in parallel, improving performance.
- Supports Oracle, PostgreSQL, DB2, MariaDB, MySQL, and MSSQL.
- Efficient parallel comparisons using hashing.
- Handles batch processing for performance tuning.
- Stores configurations for multiple comparison projects in a central repository.
Before initiating the build and installation process, ensure the following prerequisites are met:
- Java 17 or later.
- Maven 3.8 or later.
- Postgres 15 or later (for the repository).
- Supported JDBC drivers (DB2, Postgres, MySQL, MSSQL and Oracle currently supported).
- Direct Postgres connections.
- Vue3、pnpm、TypeScript、NaiveUI、Vite5、UnoCSS
- node 20 or later
- pnpm 9 or later
- Date/Timestamps compared only to the second (format: DDMMYYYYHH24MISS).
- Unsupported data types: blob, long, longraw, bytea.
- Cross-platform comparison limitations with boolean type.
- Reserved words cannot be used for table/column names.
- If a column is quoted in the RDBMS's native case, you will need to override the
preserve_casein thedc_table_column_maptable for that column. For example, if a column was created in Oracle with quotes in upper case ("MYCOL").
git clone git@github.com:WJX20/dataCompare.git cd dataCompare mvn clean install -U change application.yml(redis:your password、postgresql:your password) ```run sql run doc/datacompare.sql ```start run DataCompareApplication ```start frontenddataCompareUI cd dataCompareUI ```Install dependencies pnpm install ```start pnpm dev ```build pnpm build ```Enter the website address in the browser. http://localhost:9725/ ```login && password default login: admin default password: 123456
Sets the fetch size for retrieving rows from the source or target database.
Default: 2000
The commit size controls the array size and number of rows concurrently inserted into the dc_source/dc_target staging tables.
Default: 2000
Defines the number of rows used in mod to report progress.
Default: 1000000
Determines how the hash is performed. Valid values are database and hybrid. When set to database the column value hash is performed on the source/target database. For hybrid the hash is performed by the pgCompare thread.
Default: database
Determines if the sorting of the rows based on primary key occurs on the source/target database. If set to true, the default, the rows will be sorted before being compared. If set to false, the sorting will take place in the repository database.
Default: true
Set the preferred scale used to cast low precision numbers.
Default: 3
Sets the number of threads to load data into the temporary tables. Set to 0 to disable loader threads.
Default: 0
Level to determine the amount of log messages written to the log destination.
Default: INFO
Location where log messages will be written.
Default: stdout
Size of message queue used by loader threads (nbr messages).
Default: 100
Defines how numbers are cast for hash function (notation|standard). Valid values are notation for scientific notation and standard for standard number casting.
Default: notation
Set to true or false, instructs the loader threads to pause and wait for the observer thread to catch up before continuing to load more data into the staging tables.
Default: true
Number of rows loaded before the loader thread will sleep and wait for clearance from the observer thread.
Default: 2000000
Set to true or false, instructs the observer whether to perform a vacuum on the staging tables during checkpoints.
Default: true
Default parallel degree to set on staging table.
Default: 0
Format used to cast numbers
Default: 0000000000000000000000.0000000000000000000000
This configuration indicates that the first n data entries will be skipped, and the hash values will be generated starting from the (n + 1)th data entry for comparison.
Default: 0
This configuration indicates how many Hash values will be generated.
Default: 2000
"batch-offset-size" & "batch-compare-size": These two configurations are used to paginate the data for querying when generating "hash comparison". For instance, only compare the data ranging from 1001 to 2000 or from 5001 to 10000.
This configuration indicates how many "check validations" are to be performed.
Default: 1000
login home datasource user verify verifyConfig verifyDetails verifyDiffDetailsdataCompare is licensed under the Apache 2.0 license.