如果我使用PouchDB移动应用程序,是否必须用CouchDB替换Mysql?

时间:2021-04-30 22:51:42

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.

目前我们有一个使用mysql数据库的Web应用程序,可通过PHP访问。我们计划推出一款使用Ionic Framework的移动应用程序,该应用程序具有离线访问权限,并且当用户通过移动设备上线时也可以与网络应用程序同步。

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

我听说过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?

所以,现在如果我必须将此技术用于移动应用程序,我是否必须用CouchDB替换现有的mysql数据库?

1 个解决方案

#1


5  

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

没有办法同步MySQL和pouchdb。因为pouchdb是基于nosql而MySQL是基于SQL的数据库。

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.

因此,如果您想与移动和Web应用程序共享相同的数据,那么您需要将它放在couchdb中。由于pouchdb的同步功能,您无需担心数据复制。 pouchdb负责同步和复制数据。

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

如果您对pouchdb和couchdb感到满意,那么您可以用couchdb替换MySQL。

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.

如果您将所有数据保存在MySQL中,那么它将不会在移动应用程序上同步,因为您在MySQL中存储了所有数据,您的应用程序将无法脱机工作。当存在活动的网络或数据连接时,它将起作用。

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.

如果你在MySQL中保留一些静态数据并在couchdb中保存可修改的数据,那么你需要为移动应用程序创建休息服务以从MySQL获取数据。除了你要为动态数据实现pouchdb之外。

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.

所以据我说,如果你真的想在移动应用程序中离线数据,而你也在寻找数据的同步,那么你应该去找couchdb。

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

在实现pouchdb和couchdb后,您的移动应用程序和Web应用程序将从pouchdb读取数据(表单客户端自己)。

#1


5  

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

没有办法同步MySQL和pouchdb。因为pouchdb是基于nosql而MySQL是基于SQL的数据库。

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.

因此,如果您想与移动和Web应用程序共享相同的数据,那么您需要将它放在couchdb中。由于pouchdb的同步功能,您无需担心数据复制。 pouchdb负责同步和复制数据。

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

如果您对pouchdb和couchdb感到满意,那么您可以用couchdb替换MySQL。

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.

如果您将所有数据保存在MySQL中,那么它将不会在移动应用程序上同步,因为您在MySQL中存储了所有数据,您的应用程序将无法脱机工作。当存在活动的网络或数据连接时,它将起作用。

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.

如果你在MySQL中保留一些静态数据并在couchdb中保存可修改的数据,那么你需要为移动应用程序创建休息服务以从MySQL获取数据。除了你要为动态数据实现pouchdb之外。

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.

所以据我说,如果你真的想在移动应用程序中离线数据,而你也在寻找数据的同步,那么你应该去找couchdb。

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

在实现pouchdb和couchdb后,您的移动应用程序和Web应用程序将从pouchdb读取数据(表单客户端自己)。