views:

645

answers:

4

Are there any open source applications that demonstrate good techniques of online-offline synchronization of databases, something like Remember The Milk does with their iPhone app, Google Gears offline mode, etc.?

+3  A: 

google gears itself is open source. you'll want to look at the localserver module.

check out code.google.com/p/gears for the main developer site, and the LocalServer source. Although gears is a complex piece of software because it has lots of components (browser plugin interface, integration with javascript, SQLite integration, etc...), it is fairly well factored, so the LocalServer source is pretty easy to follow.

Aaron
As per my understanding, Gears provides an offline database and a API to detect online/offline connectivity, it does NOT do any kind of synchronization itself. Application programmers have to do that themselves.
Swaroop C H
Thx Swaroop. I was wrong!
Aaron
+5  A: 

The Unison file synchronizer is a magnificent tool, but its source code is not for the faint of heart. You didn't ask for academic papers but I have written one I'm proud of. There was some perl code to go with that one but I'm not sure if it's of any use. If you want it send me an email.

Norman Ramsey
Thanks Norman, the paper should be helpful, will take a look. However, can the concepts in the paper be used to work for database synchronization (naive question?), sorry if I wasn't clear before that I'm specifically looking at synchronization of structured data.
Swaroop C H
Certainly the ideas of logging operations and putting the log into a normal form will be useful for databases. I expect the details of the algebra to be different. Also check out Pierce's new work on "lens programming", which is motivated by the database view update problem.
Norman Ramsey
A: 

I have experience with SymmetricDS and it is really good. It can handle a lot of scenarios. It is open source, so it can be modified or extended for some special cases. As the authors say it was developed for a real life project so you can be sure that it really works fine (and it works for me also).

Just one thing. SymmetricDS relies on database triggers, so your database must support triggers.

Bojan Milenkoski
+2  A: 

The Wikipedia article on Operational Transform references four open-source applications - Ace, Gobby, Subetheredit and So6. Perhaps one of them is able to used as a starting point for you.

While they might not work directly with your DBMS of choice, it would be worth considering Operation Transform as the basis of your synchronisation.

Daniel Paull
Thank you for this information. I didn't know that there was a whole field dedicated to this!I found this interesting also in the context of the [Google Waves "Under The Hood" talk](http://www.youtube.com/watch?v=uOFzWZrsPV0) where they talk about Operational Transform for the first 20 mins.
Swaroop C H
I had been meaning to come back here and mention Google Wave - but you're one step ahead!
Daniel Paull