Indexing

Guaranteed Availability

Prior to 2.1, Sync Gateway used system views for a variety of internal operations, including authentication and replication.

Starting in 2.1, Sync Gateway will use GSI and N1QL to perform those tasks.

A key advantage of the switch to GSI is that it supports index replicas, allowing Sync Gateway to reduce the downtime during a server upgrade, rebalance or failover from several hours to a few seconds. This change also improves overall query performance. Note that this only impacts system views. Users can continue to define views through the Sync Gateway Admin REST API. This capability is enabled by default and there are 2 properties in the configuration file which can be adjusted:

Use of GSI requires Couchbase Server 5.5, with at least one node running the Index Service. Users wanting to run Sync Gateway 2.1 with an older version of Couchbase Server will need to continue to use views, by setting the use_views property.
By default, Sync Gateway requires the Index Service to be running on at least two Couchbase Server nodes (required for index replica). Users can run with a single Index Service node by setting Sync Gateway’s num_index_replicas property to zero, but this may result in increased downtime in the event of an index node failure.