Indexing
Using Indexes to minimize system downtime in Sync Gateway
Explains the use of Global Secondary Indexes
Related Deploy topics: Deployment | REST API Access | Legacy Pre-3.0 Configuration
Overview
Sync Gateway uses GSI (Global Secondary Indexes) and SQL++ to perform a variety of internal operations, including authentication and replication.
One of the key advantages GSI is that it supports index replicas, which enables Sync Gateway to reduce the downtime — say, during a server upgrade, re-balance or failover — from several hours to a few seconds. It also improves overall query performance.
Sync Gateway 3.3 supports partitioned indexes. This enables you to divide and spread a large index across multiple nodes. For details, see Partitioned Indexes.
Configuration
This capability is enabled by default and is supported by two properties in the configuration file which can be adjusted:
Use of GSI requires Couchbase Server 5.5 or later, 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.
Sync Gateway requires the Index Service to be running on at least two Couchbase Server nodes (required for index replica).
However, users can run with a single Index Service node by setting Sync Gateway’s index.num_replicas
property to zero.
Doing so may result in increased downtime in the event of an index node failure.