3

I have 2 devices (one running an electron app, the other a react-native mobile app) using PouchDB & a CouchDB 2.0 cluster to sync data between them.

My use case is for a real-time application running on the 2 devices. I have noticed that if a document is updated on one PouchDB instance, it takes anywhere around 6-11 seconds for the newly written data to be synced with the other PouchDB instance via the CouchDB 2.0 cluster. Is this latency expected for such a setup? Is it possible to further speedup the sync times?

My trouble is that being a realtime application, that amount of latency between each update is just not feasible. Does PouchDB/CouchDB really fit my use-case?

Amal Antony
  • 6,477
  • 14
  • 53
  • 76
  • If you're writing a realtime application, an eventual-consistency model probably isn't really what you want. – Jonathan Hall Jul 04 '17 at 11:38
  • @Flimzy: I've realised that part of the latency in my case had to do with the underlying store PouchDB uses on React Native. When I changed the storage adapter to SQL Lite, the latency came down to ~ 3 seconds. Regarding, eventual consistency for real-time apps, Im not sure if that's the case since Firebase is eventually consistent too - and it's designed specifically for real time applications. – Amal Antony Jul 04 '17 at 11:46
  • I don't know anything about Firebase, but I do know that "realtime" and "eventual" are contradictory terms. – Jonathan Hall Jul 04 '17 at 19:40
  • Take a look at [RethinkDB](https://www.rethinkdb.com/) which is built for Realtime. – Alexis Côté Jul 05 '17 at 17:21
  • PouchDB 6.2 has a couple of timing bugs that could increase latency in this scenario (see https://github.com/pouchdb/pouchdb/issues/6510). You could try building Pouch from master or wait until 6.3 - hopefully released in the next week - and see if that improves things – Will Holley Jul 06 '17 at 16:56

0 Answers0