Docs Menu
Docs Home
/
MongoDB Cluster-to-Cluster Sync
/

Verify Data Transfer

On this page

  • Tasks
  • Learn More

Before you switch your application load from the source cluster to the destination cluster, you should verify that the migration was successful.

Starting in 1.9, mongosync provides an embedded verifier that can perform a series of verification checks on the source and destination cluster to confirm the sync was successful.

You should verify your data after every sync. This is important in cases where you plan to move your application load from the source to the destination cluster.

Verification Method
Description

Embedded Verifier

Starting in 1.9, mongosync includes an embedded verifier, which runs a series of verification checks on the source and destination clusters to confirm that the migration was successful. This is the preferred verification method for deployments that meet the requirements.

When the mongosync process starts, it prompts the user with a disclaimer about the embedded verifier. You must accept the disclaimer, or if you have already read and acknowledged it, start mongosync with the --acceptDisclaimer option to use the verifier.

The verifier doesn't check every aspect of a migration:

  • To verify sync on unsupported namespaces, use a different verification method.

  • To verify index sync, use the Index Comparison method.

  • To verify metdata sync, use the Metadata Comparison method.

The most basic method of verification is to compare the number of documents in each synced collection on the source cluster to the number on the destination cluster.

Before you can verify data transfer with this method, mongosync must be in the COMMITTED state.

This method only verifies a successful sync when run against clusters with insert-only workloads.

You can verify sync by comparing MD5 hashes of collections synced from the source cluster to the destination cluster.

Before you can verify data transfer with this method, mongosync must be in the COMMITTED state.

While hash comparison ensures that the destination cluster has received all changes from the source, the dbHash command locks the cluster, preventing additional writes until it completes.

Hash comparison is not possible with sharded clusters. It also does not work with standalone servers and replica sets that use MongoDB 4.4 or earlier releases, since the document field order can vary.

Migration Verifier connects to the source and destination clusters and performs a series of verification checks, comparing documents, views, and indexes to confirm the sync was successful.

Different types of data require different methods of verification. You can can use custom or manual verification to verify documents, indexes, metadata, and shard keys.

The specific method you use to verify your data depends on your application workload and the complexity of the data.

Back

Telemetry

On this page