forums › forums › SQLyog › Sync tools, Migration, Scheduled Backup and Notifications › Multiple Database Synchronization
- This topic is empty.
-
AuthorPosts
-
-
August 26, 2005 at 10:58 am #9187macrailMember
I have a server with a master db on it, this is fed by several laptops in the field who synch with the server every 15 minutes.
My problem is that when laptop 1 synchs (2 way) it changes the data on the server and I get identical db's = ok. When laptop 2 synchs (2 way) it then changes the server to reflect itself and so all changes from laptop 1 are lost. This then is repeated for the next laptop and so on.
I have tried 1 way synch as well with similar results.
What I need is for each laptop to “upload” its data and for that data to be available to all other laptops and the server.
The system is being used to sign staff into worksites and to prevent staff from signing into more than one site. I then display the data on our web site which is linked to the server db.
Any suggestions would be gratefully received.
Ian
-
August 26, 2005 at 11:08 am #19044peterlaursenParticipant
read this:
http://webyog.com/whitepaper/Using_SJA_2006_07_18.pdf
this trick might help you:
Quote:If you want to be 100% sure that you don’t lose newly created data with the sync and also want to ensure that all data is synced you can build a PK composed of any field(s) that you wouldnormally for a PK AND any other having different DEFAULT value on the two hosts. Itdoesn’t matter if that variable is a number-type and has defaults for instance “0†and “1â€respectively or it’s a char-type having defaults for instance “webhost†and “localhostâ€. With this new PK “conflicting primary keys†will not occur during sync, since the same value for the PK would never exist on both hosts with data created since last sync. The host-specific part of such PK will always tell on which host the row was first created and it will work fine with SJA and INSERTs and UPDATEs (as long as there has only been an update on one of the hosts – but after all only updating data on one server between sync’s must be elementary discipline necessary in situations like these). But think over then too how to be able to DELETE rows – the problem you run into here is that deleting from one host won’t do if you after that run a twoway-sync! You will have to DELETE from both hosts between syncs, if not the deleted row shall be written back from the host where it was not deleted. It is just an example of the “dangers†of having two DB’s in principle containing the same data and letting them develop independently. It’s your job as SJA-user or DBA to think the consequences of different situations to an end and take appropriate action, since each server will not be able to reach the data located on the other host … -
August 21, 2007 at 5:10 am #19045crhockeyMember
Hi,
Did you ever get this working (the multiple db sync, I mean)?
I have the same situation.
Thanks,
Jack
macrail wrote on Aug 26 2005, 04:58 AM:I have a server with a master db on it, this is fed by several laptops in the field who synch with the server every 15 minutes.My problem is that when laptop 1 synchs (2 way) it changes the data on the server and I get identical db's = ok. When laptop 2 synchs (2 way) it then changes the server to reflect itself and so all changes from laptop 1 are lost. This then is repeated for the next laptop and so on.
I have tried 1 way synch as well with similar results.
What I need is for each laptop to “upload” its data and for that data to be available to all other laptops and the server.
The system is being used to sign staff into worksites and to prevent staff from signing into more than one site. I then display the data on our web site which is linked to the server db.
Any suggestions would be gratefully received.
Ian
-
August 21, 2007 at 7:21 am #19046peterlaursenParticipant
The basic problem is (as explained lots of times now) that when data differs on either host, ther is no way for a couputer to tell which ones are the 'correct' ones. A 'rule' must be defined by a human.
Currently we only support the rulge: 'source overwrites target'.
@crhockey – what rule could help you here? 'latest data take precedence' or something else?
-
-
AuthorPosts
- You must be logged in to reply to this topic.