简体   繁体   中英

One pouchDB per user on the same device syncing with a single CouchDB

I have an offline app, that will use PouchDB and CouchDB to sync data with an SQL server. Several users will share the same device, so I though that each user needs his own PouchDB to store their data. Once they have an internet connection, they can synchronize data with the CouchDB, that will make the link with the SQL server.

An optional thing would be to add another PouchDB, which will be a database shared by all users to avoid data redundancy.

Is having several PouchDB on the same device with a single CouchDB a problem for synchronization? Is it a good pattern? Is adding a shared PouchDB a good thing?

  1. You can have multiple PouchDB instance on the same device. You can sync filtered subset to separated PouchDB instances. Therefore, 1-1 sync is way faster then filtered replication.

  2. & 3. It's a good pattern to store all user content into a single database. For sharable data, it's normally stored on a central database. Application layers can be added to control document ownership.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM