Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: 使用DM工具从MySQL迁移到TiDB;如果业务已写TiDB,发现有问题,要切回MySQL。如何保障写入TIDB的数据,同步到MySQL
Use the DM tool to migrate from MySQL to TiDB; if the business has already written to TiDB and issues are found, it needs to switch back to MySQL. How can we ensure that the data written to TiDB is synchronized back to MySQL?
Generally, there is a parallel phase where you can use TiCDC to achieve TiDB→MySQL. If you encounter issues and need to switch back to MySQL, and it’s difficult to distinguish the data, let me introduce a company called DataX. Use replace.
During the parallel phase, can we perform dual writes for the business?
After the data synchronization verification is completed, you can first perform dual-write synchronization for a period of time, primarily using MySQL. Once confirmed to be okay, then switch to primarily using TiDB.
Dual-write for business, or CDC synchronization; switching TIDB/MySQL through VIP has the least impact.