You can specify a Kafka partition policy for data migration tasks to improve performance. For example, you can distribute data across partitions based on hash values.
Hash algorithm
Data Transmission Service (DTS) uses the hashCode() method in Java to calculate hash values.
Configuration method
Specify the Kafka partition policy in the Configure Migration Types and Objects step of the task creation wizard. For more information, see Migrate self-managed Oracle to Message Queue for Apache Kafka and Migration scenarios.
Warning After a data migration task is started, do not change the number of partitions in the destination topic. Otherwise, data migration fails.
Policies
| Policy | Description | Advantage and disadvantage |
| Ship All Data to Partition 0 | Migrates all data and DDL statements to Partition 0 of the destination topic. |
|
| Ship Data to Separate Partitions Based on Hash Values of Database and Table Names | Uses the database and table names as the partition key to calculate the hash value, then migrates the data and DDL statements of each table to the corresponding partition of the destination topic. Note
|
|
| Ship Data to Separate Partitions Based on Hash Values of Primary Keys | Uses a table column as the partition key to calculate the hash value. By default, the primary key is used. If a table does not have a primary key, the unique key is used instead. Each row is migrated to the corresponding partition of the destination topic. You can also specify one or more columns as partition keys. Note
|
|