你能把一个PouchDB DB的内部应用程序同步吗?

时间:2022-08-13 22:51:03

I will be creating a hybrid app (i.e. phonegap/cordova or similar) that will use PouchDB to sync a read-only database from a hosted CouchDB instance.

我将创建一个混合应用程序(即phonegap/cordova或类似的应用程序),它将使用PouchDB从托管的CouchDB实例中同步一个只读数据库。

Easiest way to do this is the app ships "empty" and upon first run it needs to pull down all docs from the server before it can then be used.

最简单的方法是应用程序船“空”,在第一次运行时,它需要从服务器上拉下所有的文档,然后才能使用。

Preferred way from a user perspective is that I can somehow ship it "pre-replicated" so that it could work immediately after installation (albeit with potentially out of date data) or even if online then it only needs to sync documents which have changed on the server since the app was shipped. Is this feasible?

首选方法从用户的角度来看,我能船“pre-replicated”,工作后立即安装(虽然可能过时数据),甚至如果在线,那么它只需要同步的文件已经改变了在服务器上应用以来被运送。这是可行的吗?

I understand that the difference in download total for a user is pretty negligible (i.e. they need to download the data one way or another), but I feel users have a larger tolerance for large app sizes versus apps that require them to wait minutes the first time they run them. Also, it's possible people install apps but don't try it until a later point when they are offline or with cellular data instead of wifi (this is a distinct possibility due to the type of app it will be).

我知道下载总用户的差异是非常微不足道的(即他们需要下载数据的一种方式或另一个),但我觉得用户有更大的宽容对于大型应用程序的大小和应用程序要求他们等待分钟他们第一次运行它们。另外,人们可能会安装应用程序,但直到他们离线或使用蜂窝数据而不是wifi时才会尝试,因为这是一种很明显的可能性,因为应用程序的类型是这样的。

1 个解决方案

#1


3  

Yep, you can use the pouchdb-dump CLI to dump your database to a file, and then load it using pouchdb-load.

是的,您可以使用pouchdb-dump CLI将您的数据库转储到一个文件,然后使用pouchdb-load加载它。

#1


3  

Yep, you can use the pouchdb-dump CLI to dump your database to a file, and then load it using pouchdb-load.

是的,您可以使用pouchdb-dump CLI将您的数据库转储到一个文件,然后使用pouchdb-load加载它。