[Tutor] ways to sync databases with Python and SQLite?
Alan Gauld
alan.gauld at btinternet.com
Wed Sep 10 19:30:07 CEST 2008
"Che M" <pine508 at hotmail.com> wrote
> I get the sense that Alan's idea of a log file to tell each DB
> how to change to keep current would work. What
> are the "very hard" aspects of that?
The main issues are around conflicting edits. If both are
just adding records its OK but if one deletes a record and
the other subsequently updates the same record things
get a tad confusing!
You need to merge the two lots of changes in time
order then remove any rogue deletes and manage
parallel updates.
If you only allow additions to be sync'd then its all
a lot easier. Or you can only apply the last update
(even if for different fields). Several options to simplify
things. But too simple ultimately means inconsistent
records...
--
Alan Gauld
Author of the Learn to Program web site
http://www.freenetpages.co.uk/hp/alan.gauld
More information about the Tutor
mailing list