Confused: Couchbase Server with Couchbase Sync


So, while going through Couchbase Sync Gateway i came across a note:

Note: Do not add, modify or remove data in the bucket using Couchbase Server SDKs or the Admin Console, or you will confuse Sync Gateway. To modify documents, we recommend you use the Sync Gateway's REST API.

Now, one of my use-cases is to use buckets as a DB per user, but also at the same time being able to sync that data offline.

Sometime i would like modifications, updates to happen through the HTTP API, but from what i saw the API of Sync Gateway is a bit limited, so in a way using Couchbase Server SDK would make more sense. (Like using Ottoman, for Data modeling, and N1QL).

My plan is to use Pouch on the browser client, and backend Ottoman, and on some other cases develop some API that interface directly with Couchbase Server.

(I come from CouchDB background, and Couchbase provides more tools, and in the future if we need Enterprise Level, we would switch to that)

The note means exactly what it says. You must not make any changes in Sync Gateway’s bucket without going through Sync Gateway. if you do, doc metadata like revision IDs and channels will not update.

This is unfortunate, but required due to limitations of Couchbase Server. The next major releases of Server and Sync Gateway will eliminate this problem, as announced last week at the Connect conference.

To add to what Jens said, using a bucket per user itself is likely not to work out well. The Couchbase server buckets aren’t designed to be used that way. If I recall correctly, the current maximum recommended bucket count is something like 10-12. It’s not that you can’t use more, but most I think it will cause performance problems.