forums › forums › SQLyog › Sync tools, Migration, Scheduled Backup and Notifications › Disconnected Laptops & Pcs
- This topic is empty.
-
AuthorPosts
-
-
August 21, 2007 at 3:48 pm #10500crhockeyMember
Hi,
We are in the process of implementing an invoice application using MySQL 5 on various PCs and laptops running Windows XP and would like to do multiple 2-way synchronizations between these PCs.
The idea is to set up a MySQL 5 database on an ISP server (running Linux) as the hub.
When a sales document is created, it will have a unique PK that shows that it was created on a particular PC; however, once the sales document data is synchronized to the other PCs, any user could then modify this data, which would then need to be synchronized back to the ISP server and then the other PCs.
My concern stems from changes made on disconnected PCs (primarily laptops of managers traveling) that may not do the synchronization each day, but rather, every 3 days.
If a “record” changes in a table…does only the record get synchronized or do all records in a table get synchronized? If it is the later, this seems like it would be very problematic for the laptops that only synchronize every 3 days (causing lost data).
Thanks,
Jack
-
August 21, 2007 at 5:08 pm #24726peterlaursenParticipant
Using a multicolumn PK specific for each host will work!
This trick was actually mentioned here too:
http://webyog.com/en/whitepapers/Using_SQL…L_Databases.pdf
But there are som limitations. If you want to DELETE you willl have to do on all computers, and you can only do UPDATE on a row on one computer between syncs.
Scroll down to the paragraph 'Making the PK host-specific' for details.
Syncing will sync complete rows (or 'records') and of course rows that are identical on the two host at sync time will of course not be touched.
-
September 27, 2007 at 11:15 am #24727JacquesAudetteMember
Hi.
I'm new to all this, as i am trying to figure out if the sync agent is what i need. I haven't yet tried it, but it's coming.
My application is quite the same as the original post.
The problem i see is that, with the modified pk as mentioned in your pdf file, is that it only protects newly created data. To protect modified data, i thought of a different scenario. Please let me know if you think it is worth it.
In the document, the two-way sync is described as a one way sync source to target followed by a one-way target to source. What if we made to distinct one-way syncs instead.
First, make a one way sync from laptop to server, with a where clause limiting the rows to the ones modified on the laptop since the last update (using a timestamp on the save).
Then, make a one-way sync from the server to the laptop with all records (or at least a longer time frame to make sure data from other laptops is read back).
Of course, no items are deleted unless deleted all machines. A valid flag in the database could be used for deleted rows.
The only drawback is that if the data was modified on both the server and the laptop, the laptop wins. But this understandable.
Please let me know if this might work.
jacques.
-
September 27, 2007 at 11:38 am #24728peterlaursenParticipant
I am not sure I got your point, but it makes no difference if you run two one-way syncs or one two-way sync, if only you define source and target appropirately!
A two-way sync will first sync source>target and then target>>sync.
The only difference is that with two-way it will be done for every table before proceeding to the next table.
Was I missing something?
-
September 27, 2007 at 5:12 pm #24729JacquesAudetteMember
My point is, if we update only the locally modified on the sync laptop to server and then sync everything from server to laptop, the old data on the laptop will not overwrite the new data on the server, as it would if we synced everything from laptop to server. But with a greater time span for the update server to laptop, we are sure to get all the changes back.
Maybe i'm looking at this the wrong way…
I'll install everything as soon as possible and work on it for a while, then the ideas might get clearer in my head…
jacques.
-
-
AuthorPosts
- You must be logged in to reply to this topic.