Use the p2p Http Listener on Couchbase mobile as a REST api


#1

I have a use case where I have a very big database which I want to be replicated on a specific device and from there be accessible to multiple devices on the same network without these devices actually having the big database.

What I want to know is if I can use the Http Listener used for replication peer to peer as a rest api, effectively having a device be a “server” for other devices in the local network.

This way the devices could still work with the data but they wouldn’t have to go through the process of replicating the whole database. This is important since the use case requires devices to be able to start working with the data as soon as possible.

Is this possible at all? I’d like to know if this has been considered or tried yet, before I start tinkering with it.

mentioning @hideki since I know he’s built most of the java stuff


#2

Assuming that you are talking about 1.x, as 2.0 has no REST API. So what you mean is that you want to query the device like the Sync Gateway REST API? Yes, you can do that and in fact all of our functional testing is carried out this way.


#3

Well thank you very much! I intended to upgrade to 2.0 but I hadn’t considered that. I’ll have to revise that.