8

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?

Abhinav
  • 8,028
  • 12
  • 48
  • 89

1 Answers1

8

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).

Bhavesh Jariwala
  • 885
  • 8
  • 27
  • 2
    thanx for the answer that makes sense :) – Abhinav Jul 30 '15 at 09:21
  • Thats what I have to do I guess, store dynamic datas in couchdb which needs sync functionality and the rest in mysql – Abhinav Jul 30 '15 at 09:21
  • You can use Couchbase with PouchDB as well. – Nic Raboy Jul 30 '15 at 13:50
  • Hi All, How to use PounchDB on IOS Native Applications – Sri.. Aug 27 '15 at 05:35
  • 2
    "Because pouchdb is nosql based and MySQL is SQL based database." is nonsense. pouchDB implements couchDB's replication protocol. https://pouchdb.com/guides/replication.html That's why sync works. – txyoji Jul 24 '17 at 16:22
  • it is mentioned in pouchDB website [here](https://pouchdb.com/faq.html#what_can_pouchdb_sync_with) that pouchDB can sync with mysql by using [PouchDB Server](https://github.com/pouchdb/pouchdb-server) . can anyone give clarification regarding this – salih Jan 21 '18 at 19:13