Remote Sync with App Services / Sync Gateway

Prerequisites
To set up replication, you must first configure Sync Gateway, Couchbase Capella App Services, or another Edge Server installation, to allow Edge Server to connect.
To replicate with a Couchbase Capella database:
-
You must have created an App Service connected to the Couchbase Capella database you want to replicate.
-
You must have created an App Endpoint connected to the App Service, with access to the collections you want to replicate.
-
The App Endpoint must be active.
-
You must have set up a username, password, and authentication providers to enable Edge Server to connect to the App Endpoint.
-
You must have allowed IP access from the address that the Edge Server client will use.
-
You must have copied the public connection URL for the App Endpoint.
For more information about Capella App Services, see Manage App Services for Mobile and Edge.
To replicate with a remote Sync Gateway:
-
You must have access to a working Couchbase Server deployment configured for Sync Gateway. See Configure Server for Sync Gateway.
-
You must have configured the appropriate RBAC Roles on Sync Gateway.
-
You must have set
database.import_docs
anddatabase.enable_shared_bucket_access
to true in the Sync Gateway Database Configuration Schema.
For more information about Couchbase Sync Gateway, see Introduction
Push Upstream Changes
You can monitor changes in a keyspace using the keyspaces’s changes feed. The changes feed is based on sequences, which are abstract integer counters applied to documents. The changes feed returns the metadata (and optionally the contents) of documents that have changed since a specified sequence.
Couchbase Edge Server adopts a push, not poll approach to changes using two methods:
-
Longpoll
mode - Waiting until changes are present to report to update. -
Continuous
mode - Each change is reported as a separate JSON object, delimited by a newline (\n
). The server sends all current changes, but never ends the response; instead it sends more changes as they occur.
For more information, see Push Changes.
Syncing Your Changes
The replicate endpoint enables you to synchronize Couchbase Edge Server with another server.
You can configure Edge Server so that replication starts automatically when Edge Server starts. This is usually used for continuous replication.
For more information about continuous replication, see Start Replication Automatically.
You can also start replication using the REST API. You don’t need to set up reduplication in the configuration file to do this. Instead, you pass the replication options in the JSON request body.
For more information, see REST API Replication.