I have a newbie question which I couldn’t find an answer for that.
We have a system that uses both couchbase mobile platform & couchbase server. In order to run syncing without an issue I have learnt that I need to use restful api of sync gateway such as inserting document etc. However, in case of I got an couchbase database whose data is already inserted and there is no metadata, is there a way that I can realize syncing between couchbase server and gateway?
If you are using Sync Gateway 1.4 or earlier and Couchbase Server 4.x, then your understanding is right. There is a concept of bucket shadowing that will allow you to handle the sync w/ mobile clients but that is being deprecated so I wouldn’t recommend taking that approach.
The good news is that with Sync Gateway 1.5 / Couchbase Server 5.0 , you should have two-way sync working seamlessly between the mobile clients and server. Developer builds are available to try out -https://developer.couchbase.com/documentation/mobile/1.5/whatsnew.html.
Is moving to Sync Gateway 1.5 / Couchbase Server 5.X an option for you ?
Hi - Yes, with the latest release (now Dev), you can run N1QL queries directly against your CB and manipulate documents and it will be synced over to the mobile clients via the sync gateway.
Under the hood, the server does not call REST API on sync gateway. At a high level, there is sophisticated high performance DCP protocol between the CB Server and Sync Gateway that handles the sync. Also some core architectural changes to the way the sync metadata is stored - its moved away from the _sync field in document to XATTRs…
I am using syncgatway 2.0, and couchbase server 5.0. I have loads of existing documents in the system as per the above discussion i assumed there would be a two way sync between sync_gateway and couchbase bucket. But Any document created or updated does not reflect in the sync_gatway.
Please find the config in my sync_gateway below.
After implementation of two way sync. I took the backup of the bucket with cbbackup which is working great. But when we use cbrestore to import the bucket with documents it leads to issue usually conn.sen() failure it is happening only on the buckets with two way sync.
What is the best approach to take backup for the same. One would always prefer to have a file backup don’t they.