1
votes

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

1
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 luckAngel Paraskov
@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.balsagoth
It is not so hard to iterate over all dbs. There is plugin for that even list all dbs - github.com/nolanlawson/pouchdb-all-dbsAngel Paraskov

1 Answers

1
votes

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.