https://github.com/orbitaloop/WebSqlSync
http://quickconnect.pbworks.com/Using-Enterprise-Synchronization
To use this lib, you need to use the DataAccessObject of the framework to access your DB. It works by storing all the SQL request applied to the DB (except select of course) , and sending them to the server. It's great to manage deletion, but it's a little heavy if you have a lot of updates, and the server need to use the same SQL language...
http://www.quickconnectfamily.org/qcdbsync/ (I think it store also the history of all the SQL requests)
https://github.com/zefhemel/persistencejs
"persistence.js is an asynchronous Javascript object-relational mapper library. You can use it in the browser, as well on the server (and you can share data models between them)."
They have a DB synch module: DOC of persistence.synch.js
(works with HTML5 DB SQLite or Google Gears on the client, and MySQL on the server)
http://impel.simulacre.org/api/Impel.inTouch
http://www.sencha.com/products/io/
I have developed a generic sync solution called WebSqlSync.
It's not dependant of any framework. It's available here : https://github.com/orbitaloop/WebSqlSync
Extract of the README file :
Automatically synchronize a local WebSql database (SQLite in the navigator) to a server. (2 way sync : client <-> server)
Very easy to integrate to your existing app and very easy to use (2 functions to call : initSync and syncNow)
You need to initialize the lib (at each startup for example).
It will automatically create 2 tables (if they don't already exists, one to store all the new or modified elements (table new_elem) and one to store the date of the last sync (table sync_info). It will also create SQLite triggers in order to watch the INSERT or UPDATE on the tables you want to synchronize (to automatically insert the modified elements in the new_elem table):
DBSYNC.initSync(TABLES_TO_SYNC, webSqlDb, sync_info, 'http://www.myserver.com', callBackEndInit);
Where TABLES_TO_SYNC is the list of table that you want to sync with the server, ex :
TABLES_TO_SYNC = [
{tableName : 'table1', idName : 'the_id'},
{tableName : 'table2'} //if idName not specified, it will assume that it's "id"
];
To start the synchronization, you need to call the syncNow function. You can call it every X seconds, or after some changes for example :
DBSYNC.syncNow(callBackSyncProgress, function(result) {
if (result.syncOK === true) {
//Synchronized successfully
}
});
And that's all you need to do on the client. On the server side, you will need to code your own solution (but it's not complicated). And there are some example inPHP & Java. Again, contributions are welcome.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With