You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Partitioned indexes in Sync Gateway offer horizontal scalability for large deployments by sharding indexes across multiple nodes.
17
17
This can decrease performance, as each partition is queried separately and results are aggregated.
18
-
Only `allDocs` and channels indexes can be partitioned.
18
+
Only `allDocs` and `channels` indexes can be partitioned.
19
19
20
20
[#when-to-use]
21
21
== When to Use Partitioned Indexes
@@ -55,10 +55,7 @@ The size of Sync Gateway's indexes is correlated to:
55
55
* The number of documents in a collection.
56
56
* The number of channels each document is assigned to.
57
57
58
-
If index size is a concern, your first approach should be to:
59
-
60
-
* Split documents across multiple collections.
61
-
* Review and minimize channel fan-out.
58
+
If index size is a concern, your first approach should be to split documents across multiple collections.
62
59
63
60
Query performance is sensitive to channel design.
64
61
Systems with many small channels tend to perform worse than those using fewer, larger channels.
@@ -86,7 +83,7 @@ The advantage is no downtime; the disadvantage is temporarily higher resource us
86
83
87
84
. Wait for completion via xref:rest_api_admin_static.adoc#tag/Database-Management/operation/get_db-_index_init[`GET /{db}/_index_init`].
88
85
89
-
. Run xref:rest_api_admin_static.adoc#tag/Database-Configuration/operation/post_db-_config[`POST /{db}/_config`] to use new indexes.
86
+
. Run xref:rest_api_admin_static.adoc#tag/Database-Configuration/operation/post_db-_config[`POST /{db}/_config`] with `index.num_partitions` updated in the configuration to use new indexes.
90
87
91
88
. Run xref:rest_api_admin_static.adoc#tag/Server/operation/post__post_upgrade[`POST /_post_upgrade`] to remove old indexes.
92
89
@@ -143,7 +140,7 @@ If your deployment uses xref:configuration-overview.adoc#lbl-config-grp[Configur
143
140
Misalignment between config groups can lead to unexpected deletion of active indexes if xref:rest_api_admin_static.adoc#tag/Server/operation/post__post_upgrade[`POST /_post_upgrade`] is run.
144
141
This will result in:
145
142
146
-
* Doing a CBS sequential scan on the Query nodes, which will seriously degrade performance of Query nodes.
143
+
* Couchbase Server (version 7.6 and later) falling back on a sequential scan of the Query nodes, which will seriously degrade Query performance.
147
144
148
145
* Recreating indexes that were deleted by another config when a node is rebooted with a different `index.num_partitions`, even after xref:rest_api_admin_static.adoc#tag/Server/operation/post__post_upgrade[`POST /_post_upgrade`] is run.
149
146
@@ -155,9 +152,9 @@ This will result in:
155
152
156
153
To identify the current index configuration, you can:
157
154
158
-
* Use xref:rest_api_admin_static.adoc#tag/Database-Management/operation/get_db-_index_init[`GET /{db}/_index_init`] to verify the `settings.num_partitions` in use.
155
+
* Use xref:rest_api_admin_static.adoc#tag/Database-Configuration/operation/get_db-_config[`GET /{db}/_config`] to check the active configuration in `index.num_partitions`.
159
156
160
-
* Use xref:rest_api_admin_static.adoc#tag/Database-Configuration/operation/get_db-_config[`GET /{db}/_config`] to check the active configuration.
157
+
* Use xref:rest_api_admin_static.adoc#tag/Database-Management/operation/get_db-_index_init[`GET /{db}/_index_init`] to see if there is an index creation in progress.
@@ -671,12 +671,14 @@ It is recommended to test the upgrade on a staging environment before upgrading
671
671
672
672
The known issue xref:release-notes.adoc#2-5-0[CBG-394], means that the upgrade will *require downtime* when enabling shared bucket access on an existing deployment that is running with GSI indexing. This is to allow all documents to migrate, using index-based data requests whilst migration is in progress could result in an incomplete data set being returned (containing only those docs migrated at the time of the request). You are advised to schedule a maintenance window to allow time for migration to complete.
673
673
674
-
| *Sync Gateway 2.1 or above*
675
-
`index.num_replicas: 1`
676
-
| *Sync Gateway 2.1 or above*
674
+
| *Sync Gateway 2.1 to 3.2*
675
+
`num_index_replicas: 2` (or n)
676
+
| *Sync Gateway 3.3 or later*
677
677
`index.num_replicas: 2` (or n)
678
678
2+|
679
679
After restarting Sync Gateway with the updated configuration file, the number of Index Replicas in the Couchbase Server cluster is automatically updated.
680
+
681
+
As of Sync Gateway 3.3, `num_index_replicas` still works, but this option has been deprecated in favor of `index.num_replicas`.
Sync Gateway 3.3 introduces support for partitioned indexes.
28
28
Partitioned indexes offer horizontal scalability for large deployments by sharding indexes across multiple nodes.
29
-
Only `allDocs` and channels indexes can be partitioned.
29
+
Only `allDocs` and `channels` indexes can be partitioned.
30
30
31
31
Partitioned indexes are not intended for general use in Sync Gateway.
32
32
They may decrease performance, as each partition is queried separately and results are aggregated.
@@ -41,7 +41,7 @@ Sync Gateway 3.3 introduces an option to disable the xref:rest_api_public.adoc#t
41
41
That operation is intended mainly for debugging in a small setup.
42
42
With a large number of documents, it may lead to timeouts and out-of-memory conditions on the Query nodes.
43
43
44
-
In any sizeable setup, it is recommended that you should instead use the xref:rest_api_public.adoc#tag/Database-Management/operation/get_keyspace-_changes[`GET /{keyspace}/_changes`] operation to get all documents for a user, or the xref:rest_api_public.adoc#tag/Document/operation/post_keyspace-_bulk_docs[`POST /{keyspace}/_bulk_docs`] operation to return any number of documents.
44
+
In any sizeable setup, it is recommended that you should instead use the xref:rest_api_public.adoc#tag/Database-Management/operation/get_keyspace-_changes[`GET /{keyspace}/_changes`] operation to get all documents for a user, or the xref:rest_api_public.adoc#tag/Document/operation/post_keyspace-_bulk_docs[`POST /{keyspace}/_bulk_docs`] operation to return a specific subset of documents.
45
45
46
46
To disable the xref:rest_api_public.adoc#tag/Document/operation/get_keyspace-_all_docs[`GET /{keyspace}/_all_docs`] operation in the Public REST API, set xref:configuration-schema-database.adoc#disable_public_all_docs[`disable_public_all_docs`] to `true` in the database configuration.
47
47
This option is set to `false` by default; it will be set to `true` by default in a future release.
0 commit comments