I have been evaluating the couch base server and its mobile SDK for the use case of our product. As the initial stage evaluation process I went some of the key concepts and the way of how couch base server works. Which leads to the limitations of the couch base server.
Our product currently requires 120 buckets for one of our customer. We have currently used CouchDB, where we can have n number of buckets based on our requirement, just we have match instance/server ROM, Cores and Size.
In the process we need couple of clarification
What should be the server and cluster configuration in terms of system for the 30 buckets
Is it possible to have more buckets in the cluster? If it is possible what should be the system configuration required to support that number?
Hi @naveenkumar.hs
Perhaps the new support for scopes and collections in Couchbase 7.0 would be useful for your requirements? You can have up to 1000 collections per cluster. Please see the documentation for more details.
Looking at the documents we need one more clarification.
In a single Couch Base Server Bucket Can we store same Json document multiple times as part of two different collections that are in different scopes or same scope.
Same JSON document can be stored in different collection with same key. If need to store in same collection you must use different key (key is unique in the collection).
bucket.scope.collection in Couchbase are analagous to database.schema.table in an RDBMS.
FYI: You can’t select all the documents in bucket (scopes,collections), you can’t select all documents in scope (all connections). You need separate queries or do UNION ALL explicitly
Only default scope and collection is supported at this time. Support for User defined scopes and collections is on our product radar but it is not available today.
Is it possible to point the Couch Base Lite to sync with different scope and collections ?
How will these different scope and collection data will differentiated in the Couch Base Lite i.e, mobile?
If we create one data from mobile to which scope and collection will it sync?
As indicated above, couchbase lite/ Sync Gateway only supports default scope and collection at this time. So it will be synced to the default scope (and _default collection) on server side.
You mentioned 120 buckets. Do all buckets need to be synced to a mobile client? I suspect not. As suggested, If you consolidate the bucket into scopes (and collections), you can keep the “Mobile aware” data in _default scope.
With the _default scope, the typical pattern for data segregation is to use a “type” identifier in documents and associate each type of document with a sync gateway channel.
In future, when sync gateway and couchbase lite is collection-aware, you can migrate mobile documents into user defined scopes.