

Ask HN: Which database stack to use for distributed offline db scheduled sync - Aheinemann

Setup: Master Database with local offline copies on mobile device which will be synchronized eventually when network connectivity is reestablished.<p>Access to Application is via HTML&#x2F;Javascript (UI in browser on notebook, tablet, mobile phone ), mobile Database on Windows Notebook serving locally connected devices, accumulating writes and eventually synchronizing with master Database in the Cloud (via VPN, Master Database inaccessible from the internet).<p>Which Database Stack &#x2F; Template Engine would support this kind of setup (Windows OS) best ?<p>Problems:
<i>Sync of conflicting writes by different offline Databases to master regarding the same record<p></i>would like to avoid complex software stack (WAMP &#x2F; LAMP) because PHP-Files &amp; database would be locally accessible at the offline-nodes. Would Prefer a windows service (or combination of services) which would include web-server, database and sync to master database without application logic accessible (and possibly altered) at offline node.<p>Have been looking at simple c# Webserver demos (seems doable) (on request: send html+forms, post+get, send resources (image, css, js, cookies), processing forms in c#, using SQLLite for local storage.<p>Database schema would have each database copy identified by Unique ID such that the master database can track which local database last updated a record and when, also keeps history of all updates per record for compliance.<p>A local database can only overwrite a record at the master db if the old value updated at the offline database was still current with the master (e.g. nobody else had written that record since the last sync). Otherwise there would be a conflict which i have no idea how to resolve (last write wins ?, could loose money or limb)<p>I am looking forward to any hints...
======
ColinCera
Have you looked at CouchDB and its mobile accomplice PouchDB? ->
[http://pouchdb.com/](http://pouchdb.com/)

That seems like a good place to start.

