BladePipe 1.7.0: Stronger alerts, Broader DB support, Faster KingbaseES scanning.
Skip to main content

MongoDB to PolarDb for MySQL

BladePipe supports data replication from MongoDB to PolarDb for MySQL. View supported migration, sync, verification, and connector capabilities.

Target DataSource:

Connection

Basic Functions

FunctionDescription
Full Data Migration

Migrate data by sequentially scanning data in tables and writing it in batches to the target database. Supported _id types: ObjectId, Long, Integer.

Incremental Data Sync

Sync of INSERT, UPDATE, DELETE is supported.

Data Verification and Correction

Verify all existing data. Optionally, you can correct the inconsistent data based on verification results. Scheduled DataTasks are supported.
For more information, see Create Verification and Correction DataJob.

Subscription Modification

Add, delete, or modify the subscribed tables with support for historical data migration. For more information, see Modify Subscription.

Position Resetting

Reset positions by timestamp to consume the oplog in a past period again.

Supported Deployment

Support master-slave, replica set, sharded cluster.

Advanced Functions

FunctionDescription
Incremental Data Write Conflict Resolution Rule

IGNORE: Ignore conflicts (skip writing), REPLACE: Replace the entire row in case of conflicts.

Handling of Zero Value for Time

Allow setting zero value for time to different data types to prevent errors when writing to the Target.

Limits

LimitDescription
Oplog Size and Retention Settings

By default, the value of replication.oplogSizeMB or storage.oplogMinRetentionHours in MongoDB is too small. If data synchronization latency is significant, unconsumed oplogs may be removed. In this case, it is necessary to increase these parameters.

Parameter Configuration for MongoDB Master-Slave Architecture

For MongoDB master-slave architecture, set the Source parameter oplogCollection to oplog.$main.

ChangeStream Mode

MongoDB 3.6 and above support changeStream for capturing incremental data changes. Set the Source parameter captureMode to CHANGE_STREAM. For sharded clusters, use the MongoDB connection string for synchronization.

Oplog Mode

When using oplog mode for data synchronization from a MongoDB instance, ensure the access to the local database.

Character Set

Support utf8, utf8mb4, latin1. Other encodings have not been tested.


Source

Prerequisites

PrerequisiteDescription
Permissions for Account

See Permissions Required for MongoDB.

Parameters

ParameterDescription
captureMode

Configure the MongoDB incremental data sync mode, supporting OP_LOG and CHANGE_STREAM modes.

changeStreamBatchSize

Set the maximum number of change events per batch for MongoDB Change Stream.

oplogCollection

Specify the collection name for MongoDB oplog. The default name is oplog.rs.

timezone

Source time zone (the default time zone is UTC).

Tips: To modify the general parameters, see General Parameters and Functions.


Target

Prerequisites

PrerequisiteDescription
Permissions for Account

A privileged account or a normal account with read and write permissions of PolarDbMySQL.

Port Preparation

Allow the migration and sync node (Worker) to connect to the PolarDbMySQL port (e.g., 3306).

Parameters

ParameterDescription
keyConflictStrategy

Strategy for handling primary key conflicts during write in Incremental DataTask:

  • IGNORE: Ignore conflicts (default)
  • REPLACE: Replace conflicts (optional)

dstWholeReplace

Convert INSERT and UPDATE operations into full row replacement in the Target.

mergeMaxInsertSize

When the parallel strategy mergeMaxInsertSize is set to TABLE_IMPORT_OPTIMIZE, it defines the maximum number of rows to merge per batch for the same table (improve parallelism).

Tips: To modify the general parameters, see General Parameters and Functions.