MattMatt
MattMatt

Reputation: 31

When Spring Data Couchbase and Syncgateway Couchbase would support named scopes or collection

Please find below a question on the Couchbase product roadmap.

CONTEXT

I am currently working on a feature to turn an existing system (a backend app and a mobile app) into a multi-tenant app.

The stack would be :

Couchbase 7.0 Spring Boot 2.5.5 Spring Data Couchbase : 4.2.5 SyncGateway : 2.8

PROBLEM

As far as I read in the documentation a good practice would be to use the new Couchbase 7.0 feature : Scopes and Collection. However, everything does not seem to be ready :

The theory :

https://blog.couchbase.com/scopes-and-collections-for-modern-multi-tenant-applications-couchbase-7-0/ https://blog.couchbase.com/how-to-migrate-to-scopes-and-collections-in-couchbase-7-0/ and

In practice :

1- Spring Data Couchbase is (v4.2.5) not release yet to work with named scopes or collections

https://docs.spring.io/spring-data/couchbase/docs/4.2.5/reference/html/#reference 4.3.0-M3 github example give @Collection annotation which work but are not mentionned in the documentation.

2- Couchbase SyncGateway 2.8 is not compatible and 3.0 documentation does not mention a compatibility

Sync Gateway offers support for Couchbase Server’s default scopes and collections (Default Collections). It does not currently support named scopes or collections (Named Collections).

https://docs.couchbase.com/sync-gateway/current/server-compatibility-collections.html#using-collections

QUESTIONS

To plan the project, or change the data structure (for example just using buckets) do you know when the full stack would be compatible with named scopes and collections ?

Do you know when Spring Data Couchbase 4.3.0 would be released (because 4.3.0-M3 version seems to be ok) ?

Do you know when a Syncgateway version compatible with named Scopes and Collections would be released ?

Thank you very much for your help.

Regards,

Matthieu.

Upvotes: 3

Views: 379

Answers (3)

Michael Reiche
Michael Reiche

Reputation: 533

@MattMatt - I'm not familiar with the syncgateway api - but all that is needed for collection support for n1ql/query is an http parameter query_context=default:<bucket-name>.<scope-name> (bucket-name and scope-name escaped separately with back-tics) and then instead of specifying the bucket-name in the query, specify the collection-name. If the syncgateway has an api to add 'raw' http parameters, that could be used for n1ql/query without specific collection support.

Upvotes: 0

rajagp
rajagp

Reputation: 1443

Named scopes and collections support on Sync Gateway is on our radar. We do not have a publicly available timeline at this point.

Note that until that is supported, there are alternate ways to deploy multi-tenant applications using Sync Gateway. You can point sync gateway databases to separate buckets or use the type value prefix pattern to segregate documents by tenant.

The new configuration approach in Sync Gateway 3.0 (beta) simplifies the administration of multi-tenant deployments by allowing sync gateway database configuration for tenants to be managed independent of each of other.

Upvotes: 1

mn_test347
mn_test347

Reputation: 452

Spring Data Couchbase 4.3.0 with Collections support is scheduled to be released on November 12. The try-cb-spring sample uses collections. I can't speak for Sync Gateway. Mike

Upvotes: 1

Related Questions