node.js - Pouchdb <> Couchdb sync : how to structure code -


imagine setup node/express/vue project :

  • desktop app (electron) : writes pouchdb (offline first) possibility sync remote db.
  • web app (online) : uses api server calls write couchdb

so :

  • pouchdb on client
  • couchdb on server

these 2 use same data , know can sync (master-master db) them.

i'm wondering how manage code achieve this.

  1. is possible use same controllers/models interact both databases?
  2. or have write controllers/models on server interact couchdb , write other controllers/models on client interact pouchdb?
  3. how structure project ?

thank clarify this, can't seem find clear answer , i'm total noob.


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -