Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do I have to replace Mysql with CouchDB if I am using PouchDB for mobile app?

Currently we have a web app that uses mysql database which is accessd via PHP. We are planning to have a mobile app using Ionic Framework that will have offline access and also sync with the web app when ever user comes online through mobile.

I have heard about http://pouchdb.com/

So, Now If I have to use this technology for mobile app, do I have to replace my existing mysql database with CouchDB?

like image 429
Abhinav Avatar asked Jul 30 '15 06:07

Abhinav


1 Answers

There is no way to sync MySQL and pouchdb. Because pouchdb is nosql based and MySQL is SQL based database.

so if you want to share same data with mobile and web application then you need to put it in couchdb. because of sync functionality of pouchdb, you need not to worry about the data replication. pouchdb take care about sync and replication data.

If you are comfortable with pouchdb and couchdb then you can replace MySQL with couchdb.

If you keep all your data in MySQL then it is not going to be sync on mobile application, Because you all data store in MySQL your application will not work offline.it will work when there is active network or data connection.

If you keep some static data in MySQL and modifiable data in couchdb then you need to create rest service for mobile application to get data from MySQL. As well as you are going to implement pouchdb for dynamic data.

so according to me if you actually want offline data in mobile app and you are also looking for sync of data then you should go for couchdb.

after implementing pouchdb and couchdb your mobile app and web application will read data from pouchdb(form client side it self).

like image 142
Bhavesh Jariwala Avatar answered Oct 14 '22 12:10

Bhavesh Jariwala