Real-time Synchronization from TiDB to TiDB

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

Original topic: tidb实时同步到tidb

| username: lindoubled

Are there any other methods to synchronize TiDB to TiDB in real-time without using binlog and TiCDC?

| username: 裤衩儿飞上天 | Original post link

dm :crazy_face:
You can try any third-party synchronization tools that are compatible with the MySQL protocol :smiling_imp:

| username: Kongdom | Original post link

:rofl: A low-end version can use ETL tools like Kettle, but it can’t achieve real-time processing.

| username: tidb菜鸟一只 | Original post link

TiDB to TiDB is definitely DM.

| username: 啦啦啦啦啦 | Original post link

DM sources can only be MySQL or MariaDB, which are databases compatible with the MySQL protocol, right? Between TiDB and TiDB, only binlog and TiCDC can be used; other third-party synchronization tools should not work.

| username: 裤衩儿飞上天 | Original post link

DM indeed has issues, there is no binlog.

| username: xingzhenxiang | Original post link

If the volume is small, try DataX, but it is not real-time.

| username: tidb菜鸟一只 | Original post link

The above statement is incorrect, it should be TiCDC. But you don’t want to use TiCDC? Why is that?

| username: liuis | Original post link

Since there is CDC, why not use it and instead create trouble for yourself?

| username: 海石花47 | Original post link

Can’t DataX do real-time? I haven’t used it before.

| username: wfxxh | Original post link

If you don’t use TiCDC and still need real-time estimation, you can only use dual writing.

| username: lindoubled | Original post link

TiCDC requires tables to have primary keys for synchronization, but once a table is created in TiDB, you can’t add an auto-increment primary key.

It seems that before the official introduction of auto_random, in order to scatter regions and avoid using auto-increment primary keys, this becomes a constraint on the TiCDC side.

| username: xingzhenxiang | Original post link

Not real-time

| username: 海石花47 | Original post link

Is it really that contradictory… It shouldn’t be.

| username: ffeenn | Original post link

Perhaps you could also consider Canal.

| username: Hacker007 | Original post link

If you need real-time, there probably isn’t any other good solution.

| username: liuis | Original post link

They said there’s no need for binlog :joy: This is a pseudo-requirement, just making things difficult for themselves.

| username: 海石花47 | Original post link

The upstream of Canal cannot be TiDB, but the downstream can be TiDB. Canal is based on the slave role and binlog parsing.