All Products
Search
Document Center

Data Transmission Service:Message ordering strategies for RocketMQ

Last Updated:Mar 28, 2026

When DTS synchronizes or migrates data to a Message Queue for RocketMQ instance, it routes each change event and DDL statement to a partition in the destination topic. The partition assignment determines the order in which downstream consumers receive messages. Choosing the right strategy lets you balance ordering guarantees against throughput.

Note

DTS only guarantees eventual consistency. If the specifications of the destination Message Queue for RocketMQ instance change (for example, by scaling up or down), the message delivery order may also change. The new order applies to all subsequent deliveries.

Ordering strategies

Note

In a Message Queue for RocketMQ instance, shard, partition, and message queue are used interchangeably — all three refer to a message queue. For more information, see Basic concepts (RocketMQ 5.x) and Basic concepts (RocketMQ 4.x).

DTS supports three ordering strategies. Choose based on how strictly you need to preserve operation order and how much throughput you require.

StrategyHow it worksTrade-offs
Deliver data in an ordered way and a unified viewDTS delivers all data and DDL statements to partition 0 of the destination topic.Preserves the creation and modification order of all objects from the source database. Performance is moderate because a single partition handles all traffic. Choose this strategy when cross-table ordering is required.
Deliver data based on hash values of database and table namesDTS computes a hash from the combined database and table names and uses it as the partition key. Data and DDL statements for the same table always go to the same partition. DDL statements that are not table-specific (for example, CREATE DATABASE) go to partition 0.Preserves creation and modification order per table and offers good performance. Order across different tables is not guaranteed because each table routes to a different partition. Choose this strategy when per-table ordering is sufficient.
Deliver data based on hash values of a specified columnDTS computes a hash from a column value and uses it as the partition key. By default, this is the primary key. If no primary key exists, the unique key is used instead. You can also specify one or more columns as the partition key. DDL statements go to partition 0 by default. If a table has no primary key or unique key, all its data and DDL statements go to partition 0.Offers the highest performance. Guarantees ordering only for changes to a single record. Does not guarantee order across different tables or for tables without a primary key. Choose this strategy when maximum throughput is the priority and per-record ordering is sufficient.

Select the ordering strategy

Select the Rules of the ordered messages delivered to RocketMQ. option in the Configure Objects step when you set up a DTS data synchronization or migration instance.