Connect android and ios devices to Couchbase Server (or Sync Gateway)?


#1

Hello,

I develop android and ios apps and I’m new to Couchbase.

I have tested with replication, and it works great!

Now I would like to test without replication.
I have tried to create, retrieve and delete documents by http request, and it works fine.
But, is it possible to connect from an application on an android (or ios) device to Couchbase Server database (or Sync Gateway) by Ektorp way or another? (no REST API)
If it is possible, where can I learn?

I have been looking for and testing, but I did no succeed.

Thanks, and sorry if the question is too simple.


#2

You’re asking if you can interact directly with the Sync Gateway from an iOS/Android app without using a local database? Yes, you can send commands to the gateway’s REST API. On Android you can use Ektorp for this; on iOS use CouchCocoa.

This isn’t something most apps would do, though, because you lose the ability to work offline, and the requests are slower due to the network lag.

It’s theoretically possible to talk directly to a Couchbase Server, but the API is pretty complex (memcached binary protocol), and the Couchbase Server is not intended to be reachable from the ‘outside world’, only within the data center. That is, it’s not an application server.

–Jens


#3

And, where can I look how to send commands using Ektorp? I am trying several days ago, and I couldn’t.


#4

The only example code we currently have that uses Ektorp is here: https://github.com/couchbaselabs/couchbase-lite-android-ektorp/tree/master/src/instrumentTest/java/com/couchbase/lite/testapp/ektorp/tests


#5

A great example code! Thank you very much indeed, traun!!