Sync Gateway Replication Bucket


I am using the latest version of CBL + SG + CB. I have the following replication scenario:

  1. Mobile clients create json documents and sync them to ‘MyDatabase’ using the Sync Gateway
  2. The SG saves the data in the MyBucket bucket
  3. Documents are changed by the clients and by server side services and replicated in both directions.

up to here all is fine.

Can I use the ‘MyBucket’ to hold other Data that I don’t want to replicate to the clients? is this a good idea?
Can the SG handle this without affecting the replication?
or is it recommended to use the MyBucket only for Data that is intended to be replicated with the clients?


Yes, In SG config you can tell it to import document based on XYZ element types.
I would recommend tag docs you wanted to sync with an element LIKE "mSync":true in your docs , but you can pick what ever you want.

  "databases": {
    "db": {
      "server": "couchbase://localhost",
      "username": "username",
      "password": "password",
      "bucket": "default",
      "import_docs": true,
      "import_filter": `
		function(doc) {
		  if (doc.type != "mobile") {
		    return false
		  return true
    "allow_conflicts": false,
    "revs_limit": 20

docs: Configuration File | Couchbase Docs