-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ravi Thapliyal wrote:
> 3)    Has anyone does this kind of syncing? 

Yes, but in a different context.  The only way you can do it sensibly is
by keeping a journal of changes with each source.  Ideally the change
journal should have very low granularity (ie give which column changed
rather than the whole record).  To do the synchronization you send the
part of the change journal the other parties haven't seen to them and
they replay it.

Further refinements depend on how changes are made.  For example you can
record timestamps for the changes (providing the clocks are accurate) to
automatically pick the most recent change, if appropriate.  You can
record old as well as new column values which makes change conflicts
easy to detect and in some cases also automatically resolvable.  As a
bonus change journals also provide the underlying data for undo and redo.

If you have snapshots of the whole database then you can generate the
change journal on demand (eg if the other party last saw you at
particular id/time then grab a snapshot from then and from now and do
some sort of internal diff operation which will result in a cruder
change journal).

If this is still all a pain for you then there are open source projects
such as OpenSync although it is aimed at PIM style data (address books,
calendar etc).

I would recommend you start by working on your test suite with test
cases like two different sources changing the same record to different
values, to the same values, a record being changed on one source while
being deleted on another, mismatched clocks etc.  As you then start to
work on your algorithm and code it will become clear very quickly if you
are on the right path.

Roger
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAknsu+YACgkQmOOfHg372QRa/wCeOTI5OVv1Zh+WLjHiE7z+QZDH
DlgAnir/Hy+OJxG2ko6L4PF2XUrKsQJe
=Qkeb
-----END PGP SIGNATURE-----
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to