Does TiDB DM support different column names between upstream and downstream tables?

This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: TiDB DM 支持上游与下表列名不同吗?

| username: ealam_小羽

[TiDB Usage Environment] Production Environment
[TiDB Version] v6.5
[Reproduction Path] None
[Encountered Problem: Problem Phenomenon and Impact]
Currently planning to migrate 1 billion MySQL data from sharded databases and tables to the TiDB cluster, but it seems that DM documentation supports same-name column synchronization?
I would like to ask if it supports synchronization with different column names, as we plan to reorganize the column names during this migration?
[Resource Configuration]
[Attachment: Screenshot/Log/Monitoring]

| username: tidb狂热爱好者 | Original post link

Make changes after migration.

| username: ealam_小羽 | Original post link

It’s unlikely to be a full cutover online, so incremental changes would need to be double-written. I wanted to ask if there’s a way to synchronize?

| username: okenJiang | Original post link

Column name mapping is not supported :sweat_smile:

| username: dba-kit | Original post link

DM probably does not support column name mapping, but consider achieving the effect you want through views.
PS: TiDB views only support read-only views, so you can only verify read-only scenarios.

| username: dba-kit | Original post link

Additionally, it is recommended to use dual writes for gray release. Such a change from sharding to a single table is already a significant change, and if you add column changes on top of that, it becomes more prone to errors. If you write directly to TiDB and an issue arises, rolling back becomes a major problem.

PS: I checked the TiCDC documentation and couldn’t find an option for mapping table names. The feasibility of writing directly to MySQL with sharding through TiCDC is also low. A feasible solution is to synchronize changes to Kafka and then write your own consumption logic to distribute to different tables.

| username: ealam_小羽 | Original post link

Yes, actually I didn’t plan to write directly to TiDB. I intended to use sharded MySQL for writing, synchronize to TiDB, then migrate a portion of the reads to observe, and finally switch to full read and full write.

| username: dba-kit | Original post link

For full reads, you can try using views to change column names, which should also meet your needs. However, you need to test whether it can correctly use the index.

| username: ealam_小羽 | Original post link

Okay, let’s give it a try.

| username: 孤君888 | Original post link

I remember it seems to be unsupported.

| username: ealam_小羽 | Original post link

Yes, it indeed doesn’t support it. I want to see if there are any other solutions. Currently, dba-kit seems to be the most suitable.

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.