How I can retrieve data from Couchbase to iPhone without storing

I'm making social network and want to get info from Couchbase Server without sync function or have a possibility to clear local data in Couchbase Lite.

As you can understand it will grows, any sync rules won't work.

Please, advice how to do temporary data retrieving or how to clear local database without deleting document from server.

Thanks.

1 Answer

« Back to question.

Hello,

This is a common use case that many applications have done before Couchbase Mobile (Lite+Sync+Gateway), the best way to achieve this is simply to create your own REST service layer at the top of your Couchbase cluster.

It is quite easy to create the REST layer using your favorite programming language, using the Couchbase SDK available here: http://www.couchbase.com/communities/all-client-libraries

Does this make sense?

Regards
Tug
@tgrall

In that case load balancing/nodes doesn't make sense anymore, because it needed to write own balancing, for example for PHP REST API service. In that case Couchbase will be not the best solution, but I'm very like the overall idea and the features that Couchbase gives to developer of Mobile Applications don't create a backend.

Is there any plans to make Couchbase Lite to work directly with Views from Couchbase Server Cluster or maybe some another way to get data from Server into memory only?

Thanks for your time.

I am not sure to understand.
1- If you use the Sync gateway you have to put that in a load balanced environment
2- You cannot connect your mobile directly to a Couchbase cluster because you need a reliable network (all the data and cluster topology exchanges are made using TCP Socket : fast and efficient)
3- So what you have to do is use for example PHP, put multiple Apache and a load balancer to host your rest API. Then the PHP client is connected to a Couchbase cluster that can scale easily (add/remove node, fail over, ...) this is the role of the SDKs to be "cluster aware.


Is there any plans to make Couchbase Lite to work directly with Views from Couchbase Server Cluster or maybe some another way to get data from Server into memory only?

You can call Views from Couchbase since they are exposed using REST API. We are working on a REST interface at the top of the cluster :
- HTTP Interface : https://github.com/couchbaselabs/couchbase-nginx-module
- REST API Spec: http://www.couchbase.com/wiki/display/couchbase/Design+of+REST+interface...

Do you have a specific idea about what you would like to see as developer? I'll bring this to the developer team.

As an example I have the car services database and want that any of mobile device has full database from server, here is very good to use sync gateway. But, for each of them we have comments, and it isn't a good idea to sync them all to local database. We want to have an ability to retrieve data for Service (comments) only when user opens that Service in the app. And want to have an ability to load page by page. 10 comments per request. In current architecture of Couchbase Lite we have to download all Services & Comments to local database and only after we can get access to comments. And when somebody add new comment that comment will go to all devices. That is will a MBs or even GBs of information on the device after sometime, and we will need to have more powerful severs to spread data to devices, instead of just get/put only data that needed to user at current time. Especially when there will be some attachments with images :)

Is it clear the idea and the issue with Couchbase lite?