1

I'm trying to create an offline client application with PouchDB local document storage which will be syncing its data to a couchbase server. I maintain three instances of couchbase to form a cluster. For the sync I want to use the sync gateway that couchbase provides

Questions

  1. I will be running the sync_gateway on all instances of my cluster and I should be connecting to them in a round robin fashion? Is pouchdb capable of doing that, like adding more servers to replicate, and how?
  2. I set up a pouchdb simple example and a couchbase and while pouchdb managed to replicate a document to couchbase I constantly get the following error, what does this means and how I can correct it:

    GET http://localhost:4984/mybucket/_local/4jm_8Z70bAx9pah9QrJraw%3D%3D?&_nonce=1448874432705 404 (Not Found) explainError-browser.js:7 The above 404 is totally normal. PouchDB is just checking if a remote checkpoint exists.

I connect with the following snippet of code

const localDB = new PouchDB('localdb');
const remoteDB = new PouchDB('http://localhost:4984/mybucket');

localDB.replicate.to(remoteDB, {
  live: true,
  retry: true
}).on('complete', function () {
  console.log('DONE');
  // yay, we're done!
}).on('error', function (err) {
  // boo, something went wrong!
});

Is there any good example, or a simple github repo example of how to perform a simple sync as a proof of concept between pouchdb and coucbase managing authentication and replication? So far I have been reading the following resources:

  1. http://blog.couchbase.com/first-steps-with-pouchdb--sync-gateway-todomvc-todolite
  2. http://developer.couchbase.com/documentation/mobile/current/develop/guides/sync-gateway/index.html
tbo
  • 9,398
  • 8
  • 40
  • 51

1 Answers1

0

This blog-post should give you the information you need, http://blog.couchbase.com/first-steps-with-pouchdb--sync-gateway-todomvc-todolite

  • Thanks for your answer Martin, I've followed the instructions of the over mentioned blog post from the beginning but the error i mention is still a problem, do u know what exactly means and how I can correct it? This error is not produced when I use couchdb – tbo Dec 08 '15 at 10:14