2/3 way sync of a table

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Pasito
Posts: 1
Joined: Thu 20 May 2021 10:52

2/3 way sync of a table

Post by Pasito » Thu 20 May 2021 11:05

Hello there

I'm relatively new to mydac.

Yesterday i bought it again to get me started.

So, my problem:

I have two remote places with the same database structure. So i have the same data as well at this point.

When 1 place updates a row then i want to exchange that update to the other place. That goes both ways.



I can use a 3rd central mysql database if that helps synchronizing.

Anyone with experience on that topic? I would also appreciate some best practises involving mydac.


Thank you very much

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: 2/3 way sync of a table

Post by ViktorV » Fri 21 May 2021 14:05

Hi,

Thanks for your request, I will gladly assist you further.
Please be informed that MySQL allows to replicate data from one main server (master server) to numerous servers (sale servers). Data change occurs on master server and is being repeated on slaves (but not vice versa). As a result, requests to data change (INSERT, UPDATE, DELETE etc) are executed only on master and requests to read data (on other words SELECT) can be performed both on slaves and master.
You can find more information about replication here:
http://dev.mysql.com/doc/refman/5.0/en/ ... tion.html
and
http://dev.mysql.com/doc/refman/5.0/en/ ... owto.html
Kindly note that you can use two connections in your application: one for reading data and another for writing data. The connection which reads data should work with slave server, and the connection which reads data should work with master server.
You may find MySQL replication discussion on our forum:
http://forums.devart.com/viewtopic.php?t=21691
Please note that you would need to implement any other type of data synchronization manually. In order to do this, you may try using TCRBatchMove component which allows you to transfer data between different databases.
You can get more detailed information in our documentation:
https://www.devart.com/unidac/docs/deva ... hmove.htm
Also, you can use to execute dump operations and DB objects recovery, you can use the TMyDump component.
See more details about this component in MyDAC help:
https://www.devart.com/mydac/docs/devar ... ydump.htm
Please feel free to reply to this email if you have any other questions or you need any kind of additional information.

Best regards,
Viktor
Devart Team

Post Reply