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

1

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?

Mournful answered 30/7, 2015 at 6:5 Comment(0)
J
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).

Jeanmariejeanna answered 30/7, 2015 at 8:22 Comment(6)
thanx for the answer that makes sense :)Mournful
Thats what I have to do I guess, store dynamic datas in couchdb which needs sync functionality and the rest in mysqlMournful
You can use Couchbase with PouchDB as well.Rattler
Hi All, How to use PounchDB on IOS Native ApplicationsPlatysma
"Because pouchdb is nosql based and MySQL is SQL based database." is nonsense. pouchDB implements couchDB's replication protocol. pouchdb.com/guides/replication.html That's why sync works.Fraunhofer
it is mentioned in pouchDB website here that pouchDB can sync with mysql by using PouchDB Server . can anyone give clarification regarding thisKrenn

© 2022 - 2024 — McMap. All rights reserved.