[pycrypto] synchronisation 2 computers'databases

Bill Broadley bill at broadley.org
Fri Jan 30 00:34:47 CST 2009


frendy zhang wrote:
> i am currently working on synchronisation. I have 2 or more "projectA" in different computers and i would like to synchronise all the entries in the database from different computers when few entries are added into database. 
> so at the end, all the computer would have the same entries in the database 
> Do u have any example that could help me with this function? 
> Thanks in Advance 

Not sure how this relates to pycrypto.  But if you keep a unique UID per row,
and a last updated field per row it becomes very straight forward to do a:
select from table where update_time>last_sync

So server A says:
  server B, send me all records updated since X

Then server B says:
  server A, send me all records updated since X

Then you can use a flag for deleted records, an additional table, or even just
a queue, then don't purge a record till you are sure both sides are aware of the.

You didn't mention your database, but be careful not to use auto increment, or
if you do don't use that as a key/index.


More information about the pycrypto mailing list