Thanks guys. I am still structuring the solution. Will share the experience after successful execution.


Regards,

Allan

On Wed, May 25, 2016 at 9:43 PM, Derrick Wesonga via skunkworks <skunkworks@lists.my.co.ke> wrote:
Hi Allan,
I remember when HTML 5 was being introduced there was a buzz about offline mode. I have personally not tried it but I think it would be fun to explore it (http://www.html5rocks.com/en/features/offline). You can also do the same with persistent  storage with javascript, I saw this on stackoverflow, check the first answer (http://stackoverflow.com/questions/2786303/offline-mode-app-in-a-html5-browser-possible). 
If you decide to go with either of the two, kindly share your experience. It would be nice to know the results
regards,
Derrick


On Fri, May 20, 2016 at 8:57 PM, Martin Akolo Chiteri via skunkworks <skunkworks@lists.my.co.ke> wrote:
This may not be directly relevant to the question, but Microsoft has an *Amazing* offline data synchronization framework: http://www.codeproject.com/Articles/18027/Take-Data-Offline-Using-Microsoft-Synchronization  

I am yet to see a solution from other vendors that gets even half-way close. You could probably borrow ideas from there.

Martin.

On Fri, May 20, 2016 at 2:57 AM, Peter Karunyu via skunkworks <skunkworks@lists.my.co.ke> wrote:
The organisation I work for has done something similar.

In our case, we roughly followed these principles:

1. The client app has is own database, at the beginning a copy of the main server database
2. The server app also has its own database
3. The client app can exports its data into a json file, which can be imported on the server app
4. The server app can export its data into a json file which can be imported on the client app
5. The end users are the ones who initiate the sync process, so that control rests with them, but its easy to automate this sync.
6. The json import logic on the client and server is then able to deal with duplicate data

Be on the lookout for autogenerated primary keys, those can be a nasty little demon to deal with when syncing data. Infact, I would go out on a limb and suggest you dont use autogenerated primary keys but instead use something else.

Also, MySQL supports Master-Master replication, where data flows both ways. But of course it assumes that the two computers can communicate directly, i.e. public IP addresses on both (unless networking gurus have another way).

On Fri, May 20, 2016 at 11:34 AM, Allan O. via skunkworks <skunkworks@lists.my.co.ke> wrote:
Hi people,

I have a requirement to include offline functionality for an already existing web application.
The web app is built on the LAMP stack.
I am thinking of having two similar MySQL databases. One local on the clients' machines and another in the cloud, then have a way of syncing records.
MySQL offers replication but that assumes a master - slave configuration which won't work for this scenario (because data flows two way).
Anyone done this before or know the best way to implement this?


Regards,

Allan

_______________________________________________
skunkworks mailing list
skunkworks@lists.my.co.ke
------------
List info, subscribe/unsubscribe
http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks
------------

Skunkworks Rules
http://my.co.ke/phpbb/viewtopic.php?f=24&t=94
------------
Other services @ http://my.co.ke


_______________________________________________
skunkworks mailing list
skunkworks@lists.my.co.ke
------------
List info, subscribe/unsubscribe
http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks
------------

Skunkworks Rules
http://my.co.ke/phpbb/viewtopic.php?f=24&t=94
------------
Other services @ http://my.co.ke


_______________________________________________
skunkworks mailing list
skunkworks@lists.my.co.ke
------------
List info, subscribe/unsubscribe
http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks
------------

Skunkworks Rules
http://my.co.ke/phpbb/viewtopic.php?f=24&t=94
------------
Other services @ http://my.co.ke


_______________________________________________
skunkworks mailing list
skunkworks@lists.my.co.ke
------------
List info, subscribe/unsubscribe
http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks
------------

Skunkworks Rules
http://my.co.ke/phpbb/viewtopic.php?f=24&t=94
------------
Other services @ http://my.co.ke