Sync with multiple databases

跟風遠走 提交于 2019-12-12 01:36:27

问题


How do you use sync in case there are 10 databases.

Do I have to set up 10 new sync?

db = new PouchDB(this.database);

db.sync(remoteCouch, opts1)
db.sync(remoteCouch, opts2)
...

Which means it will open 10 different http connections?


回答1:


Yes, it does. In that case, you may want to avoid using live replication so you don't keep 10 HTTP connections open. (I.e. just replicate one-at-a-time.)

Or you can replicate from the 10 PouchDBs to a single in-memory PouchDB and then replicate from that to CouchDB (if your databases can fit in memory).



来源:https://stackoverflow.com/questions/35993369/sync-with-multiple-databases

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!