1

I have an app that manages prospects. These prospects are assigned to some collaborators. They have a tablet that they use to contact our clients. The mobile app has offline support and syncs with the desktop app. I have some users that manages this collaborators and they need to have access to all prospects from their collaborators.

Our current design is a cordova app, with angular and pouchdb that syncs to couchdb. The desktop app is a laravel app. We create a new couchdb database for every collaborator that syncs with their account on mobile app. The admins and supervisors needs to access, list and edit all prospects of all couchdb databases. So, we sync through a nodejs process, all prospects on couchdb databases to mysql prospects table, so we can easily list all prospects.

My question is if this design makes sense or if we should go for another way.

There is a similar question and design here

Community
  • 1
  • 1
Ivan Pereira
  • 2,149
  • 3
  • 24
  • 32
  • It looks good and very similar to what we have planned to do with CouchDB and PouchDB. My only suggestion is to have one central db for the common things(dictionaries and etc), so you don't have to copy that on each and every database. Apart from that, you cannot avoid the one db per user because of CouchDB's security. Good luck – Angel Paraskov Oct 02 '15 at 10:24
  • @AngelParaskov yes, i forgot to mention that we have one CouchDB that we named public-db with things common to all users. Is better to sync to mysql or to iterate over all dbs? It seems not to be a bad thing due to the couchdb design. – Ivan Pereira Oct 02 '15 at 11:41
  • 1
    It is not so hard to iterate over all dbs. There is plugin for that even list all dbs - https://github.com/nolanlawson/pouchdb-all-dbs – Angel Paraskov Oct 08 '15 at 15:42

1 Answers1

1

To increase security and decrease design problems with multiple databases to sync, I use AES encrypted data in documents. For me it is the best solution. Everyone can read but the data is securily protected.

HaKi
  • 21
  • 2
  • I did also mention it at a similar question at http://stackoverflow.com/questions/32030347/cordova-web-app-using-pouchdb-couchdb-schema-design/33585439#33585439 – HaKi Nov 07 '15 at 17:12