Couchbase Server5.5 + Sync Gateway + Couchbase Mobile 2.x + Pouchdb possible?

My response addresses more than just your specific question because I want to ensure you have the chance to review all your options depending on your needs

Are you looking for offline storage within your browser app ? If not, here are some options

  • you can interact with the Sync Gateway directly through the REST API . You can setup a a longpoll listener for changes feed, create Sync Gateway users etc. If you want to sync changes from client, you have to manually handle writing the documents.
  • You can also build out your front end using any suitable framework and a web backend that can use any of our existing server SDKs to interface with Couchbase server. Changes made from the SDK app and mobile clients will be synced with each other through shared bucket access capability. Here is an example. Of course, you cannot subscribe to Sync gateway changes feed etc

If you are looking for offline storage capabilities within your browser app, then here are the options -

  • You can use HTML5 offline storage and use the Sync Gateway REST API longpoll API to listen to changes. Of course, that works if you are looking to sync from the server. If you want to sync changes from client, you have to manually handle writing the documents.
  • PouchDB is an option if you need offline storage support and this is the state of things -
    • Sync Gateway 2.0 is compatible w/ PouchDB/CouchDB to the extent that the 1.x version of Sync Gateway was.
    • Caveats
      • There are a couple of known issues with the compatibility but it should be possible to work around those easily.
    • We do not test compatibility with PouchDB. So there may be issues in addition to the ones that were discussed above that we may not be aware of.
    • We cannot guarantee that there won’t be changes in Couchdb/PouchDB in future that break this compatibility . Essentially, we do not strive to be compatible with the protocol. So you have to be cognizant of this every time you upgrade PouchDB .

Essentially, if you must decide to use PouchDB best way forward is for you to do a quick PoC and be aware of potential implications during upgrade.

1 Like