You can use Data Transmission Service (DTS) to synchronize data from a MongoDB database (replica set architecture) to another MongoDB database (replica set architecture or sharded cluster architecture).
Supported source and destination databases
The following table lists the types of source and destination MongoDB databases that are supported by DTS. In this example, the source database is an ApsaraDB for MongoDB instance (replica set architecture) and the destination database is an ApsaraDB for MongoDB instance (replica set architecture or sharded cluster architecture). You can also follow the procedure to configure data synchronization tasks for other types of MongoDB databases.Source database | Destination database |
---|---|
ApsaraDB for MongoDB instance (replica set architecture) | ApsaraDB for MongoDB instance (replica set architecture or sharded cluster architecture) |
Self-managed MongoDB database that is hosted on ECS (replica set architecture) | Self-managed MongoDB database (replica set architecture or sharded cluster architecture) |
Self-managed MongoDB database that is connected over Express Connect, VPN Gateway, or Smart Access Gateway (replica set architecture) | Self-managed MongoDB database that is connected over Express Connect, VPN Gateway, or Smart Access Gateway (replica set architecture or sharded cluster architecture) |
Prerequisites
- The source ApsaraDB for MongoDB instance (replica set architecture) and the destination ApsaraDB for MongoDB instance (replica set architecture or sharded cluster architecture) are created.
For more information, see Create a replica set instance and Create a sharded cluster instance.
Note For more information about supported MongoDB versions, see Overview of data synchronization scenarios.
- The available storage space of the destination ApsaraDB for MongoDB instance is larger than the total size of the data in the source ApsaraDB for MongoDB instance.
- If the destination ApsaraDB for MongoDB instance is deployed in a sharded cluster architecture, you must create databases
and collections to be sharded in the destination ApsaraDB for MongoDB instance and configure sharding based on your business needs. For more information,
see Configure sharding to maximize the performance of shards.
Note
- After you configure sharding for a cluster, the synchronized data will be distributed among different shards. This maximizes the performance of the sharded cluster.
- The shard nodes in a sharded cluster instance must share the same account password and endpoint. For more information, see Apply for an endpoint for a shard or Configserver node.
Limits
Category | Description |
---|---|
Limits on the source database |
|
Other limits |
|
Special cases | If the source database is a self-managed MongoDB database, take note of the following
limits:
Note If you select an entire database as the object to synchronize, you can create a heartbeat.
The heartbeat is updated or receives data every second.
|
Billing
Synchronization type | Task configuration fee |
---|---|
Schema synchronization and full data synchronization | Free of charge. |
Incremental data synchronization | Charged. For more information, see Pricing. |
Supported synchronization topologies
- One-way one-to-one synchronization
- One-way one-to-many synchronization
- One-way many-to-one synchronization
- One-way cascade synchronization
Synchronization types
Synchronization type | Description |
---|---|
Schema synchronization | DTS synchronizes the schemas of the required objects from the source ApsaraDB for MongoDB instance to the destination ApsaraDB for MongoDB instance. |
Full data synchronization | DTS synchronizes historical data of the required objects from the source ApsaraDB for MongoDB instance to the destination ApsaraDB for MongoDB instance.
Note DTS supports full data synchronization for the following types of objects: database,
collection, and index.
|
Incremental data synchronization | DTS synchronizes incremental data from the source ApsaraDB for MongoDB instance to the destination ApsaraDB for MongoDB instance.
Note DTS supports the following types of incremental updates:
|