Auto-Create Remote Collections?

I’m using the Couchbase Swift SDK to build an application. I’d like to configure sync so that collections I create in the local database are automatically created on the server if they don’t already exist in whatever scope I’m using.

This would save me a bunch of needless hassle as the application evolves and new collections are added in new versions of the app. It’s the way MongoDB and Realm worked, which was quite pleasant.

Context:

This app requires each user (hollywood studios) to have a completely separate bucket on the server. No sharing. Fleets of lawyers are standing by to devour the flesh of anyone who suggests a shared architecture, etc. Each user will have several scopes (production, testing, scratch for employee training, etc.) So each time I need to add a collection, I’ll have to add it in 50 different places.

Question:

Is it possible to have the server auto-create missing collections and I just can’t find the configuration option to allow it? If it’s not possible, is it on the roadmap?

Hi,

Unfortunately that’s not possible to do today out of the box, and we don’t have any plans currently to implement this.

It would be possible to achieve this behaviour with your own backend running the appropriate Couchbase Server and Sync Gateway APIs to create and assign collections to Sync Gateway databases - but appriciate this is a bit of a hassle, especially if you already don’t have a backend service set up to do so.

Thanks! Bit of a shame because that means a lot of needless configuration busywork on an ongoing basis.

I feel your pain, but allowing a client app to create buckets on the server would be a massive vector for denial-of-service attacks against Capella as a whole. Buckets are fairly expensive resources.

Not looking to auto-create buckets or scopes, just collections within a given scope.

Oh! Yes, that makes more sense. But apparently it’s not supported. If you’re a customer, feel free to submit a support request to ask for this feature.