SyncGateway metadata documents path

Hi all,

we’re using two pull replication between two Couchbase SG instances, connected to two different Couchbase Servers.
While creating the databases/users/replications, the “_sync:” documents are generated in the collection, to keep track of the changes and synchronization status.

The application working with the data in the replicated collections has then to filter the “_sync:” documents in order to not display them and to not throw any error/exception.

Is there a way to redirect all those metadata documents with the ID prefix “_sync:” to a specific collection, in order to leave the replicated collections free?

This is something we want to do with the introduction of internal system collections added to Couchbase Server recently.

It’s not yet fully on the roadmap in Sync Gateway, but we’re working to get it on there and come up with an auto-upgrade strategy to migrate existing metadata.

1 Like

Hi Ben, many thanks for the prompt answer!

Is there any documentation about the newly added “internal system collections” on the Couchbase Server?
Are them introduced with the version 7.2.4?

I would like to know more about them :wink:

Hi @bbrks,

from the last update (7.6.0) i see that _system scope was introduced in each bucket: Scopes and Collections | Couchbase Docs

Is the _mobile collection used to take care of all the SG _sync documents?
When using SG with named collection enabled, the document which takes note of the database name is still created in the collection (as far as i remember is the _syncinfo document)?

All current Sync Gateway versions will not be using the system collection yet.

We’ll be planning on utilizing this feature in an upcoming Sync Gateway release, but only once Server 7.6 has had more uptake.

We also need to ensure that there’s a clear and automated migration path for existing metadata.

1 Like

Hi Ben,

thanks for the updates.

My problem is that the applications connected to Couchbase, don’t expect a document with the id “_sync%” in the collection, so they’re going in the error status.

Is there any tip to avoid that, or the only solution is to rewrite the application’s queries in order to skip the “_sync%” documents?