Let's assume we want to develop an ionic app client (or an angular app) and we have an existing mysql database in the backend. How would you best synchronize your data in the frontend with the server's database?
Assume the following 2 approaches:
1) The JSON data is sent to the server via an API and the API is responsible for the data mapping and persistence.
2) We use PouchDB/CouchDB, MongoDB or any other database on the client and want to synchronize it with our mysql server db via replication.
What do you think are the pros and cons of both approaches with regards to below topics?
- data mapping and flexibility of data models
- transferred data is JSON text and image files
- easy setup, maintenance and usage
- reliable solution
- secure data transfer (authentication, ...)
- offline usage of client
- push notifications
- other issues?