All Products
Search
Document Center

Data Transmission Service:Rules of the ordered messages delivered to RocketMQ

Last Updated:Feb 27, 2025

When Data Transmission Service (DTS) synchronizes or migrates data to an ApsaraMQ for RocketMQ instance, you can configure the rules of the ordered messages to improve the performance of a data synchronization or migration instance. This topic describes the rule policies of the ordered messages that DTS supports.

Usage notes

If you want to upgrade or downgrade the class of the destination ApsaraMQ for RocketMQ instance in DTS, the message is delivered in a new rule configuration different from before.

Policies

Note

In an ApsaraMQ for RocketMQ instance, the terms Shard, Partition, and MessageQueue all represent message queues. For more information about the concepts of ApsaraMQ for RocketMQ, see Terms and Terms.

Name

Description

Advantages and disadvantages

Deliver data in an ordered way and a unified view.

DTS delivers all data and DDL statements to Partition 0 of the destination topic.

  • Advantage: The order in which all objects are created and changed is the same as that in the source database.

  • Disadvantage: This policy provides ordinary delivery performance.

Deliver data based on hash values of database and table names.

DTS uses the database and table names as the partition key to calculate the hash value. Then, DTS delivers the data and DDL statements of each table to the corresponding partition of the destination topic.

Note
  • The data and DDL statements of the same table are delivered to the same partition.

  • If a DDL statement is irrelevant to a table, for example, CREATE DATABASE, the statement is delivered to Partition 0.

  • Advantage: The order in which a destination table is created and changed is the same as that of the source table. This policy provides good delivery performance.

  • Disadvantage: Tables are delivered to different partitions. After data delivery, the order of data changes on different tables may become inconsistent.

Deliver data based on hash values of a specified column.

DTS uses a table column as the partition key to calculate the hash value. The table column is the primary key by default. If a table does not have a primary key, the unique key is used as the partition key. DTS delivers each row to the corresponding partition of the destination topic.

Note
  • If you use this policy, DDL statements are migrated to Partition 0 of the destination topic by default.

  • If a table does not have a primary key or unique key, DTS delivers the data and DDL statements of the table to Partition 0 of the destination topic.

  • Advantage: This policy provides the best delivery performance.

  • Disadvantage: After data delivery, the order of data changes on each data record remains the same. However, the order of data changes on different tables or tables without a primary key may become inconsistent.

Configuration method

You can configure the Rules of the ordered messages delivered to RocketMQ. in the Configure Objects phase of a data synchronization or migration instance.