Creating a DB over the public API is unsupported?

#1

Hi, Im using REST API for creating new db, but i got error like Creating a DB over the public API is unsupported

source http://developer.couchbase.com/documentation/mobile/1.1.0/develop/references/couchbase-lite/rest-api/database/put---db-/index.html

#2

That’s likely due to the idea that Sync Gateway listens in two places. One is the “public” side, that’s on all IPs on the system. The other is the “admin” side, which listens only on localhost. Thus, you’ll want to create the DB on the admin side.

I don’t know but I suspect the create DB is there but responds unsupported for CouchDB compatibility.

#3

do you mean, Admin Rest API have use with localhost:4985 or else can i use like myurl:4985.

actually i want to create DB from IOS app, so is there any possibilities to do that.

#4

Yes, I mean port 4985 which is documented as something you should not expose to the 'net at large. See the docs there.

If you want to create the database from the iOS app across the web to Sync Gateway, you can do so by building another process that runs locally to it and route that request through that local process. This gives you a point of control and you won’t need to expose all of those URIs.

It may be better to describe a bit more fully what you’re trying to do. Normally the iOS side is something your users would have, not administrators. As such, it’s slightly unusual to be creating a DB from there. What are you trying to achieve by that?

#5

Hey thanks for reply,

Yes, me to work around like creating a light weight API call for communication to server, using that API, i will use ADMIN REST API, it will create DB locally.

Coming to the point, creation of DB, my application is like one to many, single application can use multiple companies with their own Database in one server. its something cool feature in my application.

How to work around channels in Couchbase Lite?
#6

You may want to investigate channels as a way to separate out many companies within a single Database for this kind of hosting environment. As of this writing, the number of buckets in Couchbase Server can be a limitation, and each DB created through SyncGateway would be a bucket.

Channels, on the other hand, can scale to a large number. This may work well for your use case since many companies can share Sync Gateway and server instances, just using channels and sync functions to enforce access control.

#7

Thanks for suggestions, i will check it.

#8

can we create channels in Synch gate way or else, is there any possibilities to work on channels in Couchbase Lite.

#9

I’m sorry, but I don’t understand your question. Maybe you can rephrase it?

#10

i mean, how to create or add channels to document for each client in couchbase lite. for this i read channels but they are no guidelines for how to do in Couchbase Lite with iOS.

#11

Channels are not an iOS Couchbase Lite concept. They’re a Couchbase Mobile concept meaning that you implement channels between how you structure your documents and your Sync Gateway configuration. Have a look at the section on developing channels.