I am wondering how the architecture should look like when using PouchDB
as a local storage in a mobile app instead of localStorage
.
At this moment I am used to cache my app's data into localStorage
and when needed I perform an API call to the backend to request or post data. The backend is holding all logic. Such as:
- Does this user has the correct permission/role to do this action?
- Any other logic needed to check if action can be done
All data is then stored into a relational database. I have now been reading about NoSQL databases and in particular CouchDB
and PouchDB
. So I am wondering how would this architecture look like? Three questions arise at this point for me:
- If I have multiple users with there own authentication, how can I make sure that the users get access to only their data? And will I still have 1 database on server end?
PouchDB
on the client side can be in sync with a remotePouchDB
. But when an application is build with Javascript how do you make sure that people are not inserting data intoPouchDB
by 'hacking' the client-side Javascript?- Would the use of a backend be gone in these kinds of setups? And if you want to have an API for
3rd party
, you just put for example anSails.js
backend around theCouchDB
?