Trouble retrieving mobile data replicated with Sync Gateway

We’re currently using Couchbase Lite and the Sync Gateway to replicate mobile data to our Couchbase Server. We also have a web app where we want the ability to work with this data. I had thought we needed to use the Java SDK but after encountering some problems (see View Results Include Various Revisions of Documents?) it was recommended that we do not use the Java SDK, and that we have to use the Sync Gateway in our web app. Is this true? We previously used Ektorp and Jackson to work with CouchDb. Is it possible to use Ektorp with the Sync Gateway? I tried and encountered

org.ektorp.DbAccessException: java.net.UnknownHostException.

From looking at other forum posts and documentation it seems like this is supported. Is this the right approach or should we go back to looking at the Java SDK? What is the recommendation for interacting with mobile data that has been replicated to Couchbase Server with the Sync Gateway?

I appreciate any help!

Best,
Bill

Hey @Foosh,

It is best to use Sync Gateway for interacting with your data on mobile and there is a Couchbase-Lite Android Ektorp connector, are you referring to that or have taken a look?

There is also Couchbase Lite REST APIs for interacting with the mobile data you have.

Hope that helps.
William

Hey @sweetiewill,

Thanks for the response. Basically, we have an iOS app that uses Couchbase Lite to create various data records/documents. The iOS app uses the Sync Gateway to replicate this data to a centralized Couchbase Server.

Then we have a website, written with Java, where we want to provide administrative users with the ability to interact with all of the centralized data that has been replicated to our Couchbase Server from various devices. We tried using the Java SDK but ran into issues and @martinesmann told us we had to use the Sync Gateway, not the Java SDK, to work with this data. We tried using Ektorp in our website’s code to connect to the Sync Gateway but we can’t connect successfully.

My impression of the Couchbase-Lite Android Ektorp connector and the Couchbase Lite REST API was that they are both utilities that can be used to access a Couchbase Lite database, not data stored on Couchbase Server? Please correct me if I’m wrong. Can either of these connect to Couchbase Server?

Are we trying to use Couchbase Server in non-standard way? We had thought our use case was fairly typical, having mobile (and non-mobile) users generate and replicate data to a central store where data could be queried at an aggregate level. It seemed like the switch from CouchDb to Couchbase Server should be relatively straightforward but we keep encountering issues.

How do other people query Couchbase Server to view mobile data that has been synced?