0

I like to develop an Desktop App using nw.js (node-webkit) or Electron.

I am looking for a solution to sync between IndexedDB and MySQL Server + PHP(Laravel) on the cloud via Restful API.

PouchDB look good but that is out of option because it only support to sync with CouchDB.

What option do I have?

I'll-Be-Back
  • 10,530
  • 37
  • 110
  • 213

1 Answers1

1

It's possible with dexie but not as complete as you get with pouchdb. The closest you come to a complete solution with dexie is using the Dexie.Syncable addon (https://github.com/dfahlander/Dexie.js/wiki/Dexie.Syncable.js) (not yet stable) and implement the backend from the following 2 backend sample implementations:

https://github.com/dfahlander/Dexie.js/tree/master/samples/remote-sync/

If you don't want to rely on Dexie.syncable, another solution would be to build your own sync addon based on the stable CRUD hooks that Dexie provides in it's default api:

https://github.com/dfahlander/Dexie.js/wiki/Table.hook(%27creating%27)

https://github.com/dfahlander/Dexie.js/wiki/Table.hook(%27updating%27)

https://github.com/dfahlander/Dexie.js/wiki/Table.hook(%27deleting%27)

Using those hooks, may log all local changes to a dedicated table for syncing with server when it goes online. This is what Dexie.Syncable is based on.

David Fahlander
  • 5,058
  • 1
  • 20
  • 19