working example of P2P sync on android

334 views
Skip to first unread message

CouchBert

unread,
Jun 2, 2014, 5:20:18 PM6/2/14
to mobile-c...@googlegroups.com
Hey,

we are looking for an example of the p2p mechanism of couchbase lite.

We have several android devices on which we want to sync with one designated android device over wifi without using the syncgateway. We read about the P2P capabilities of couchbase lite for android, especially the feature "Off-the-grid peer-to-peer replication support via REST APIs" caught our eye. Unfortunately we couldn't find any documentation concerning this topic.

Is anyone able to provide us with an example?

Best Regards,
CouchBert

Jens Alfke

unread,
Jun 3, 2014, 12:48:01 PM6/3/14
to mobile-c...@googlegroups.com

On Jun 2, 2014, at 2:20 PM, CouchBert <paulus...@gmail.com> wrote:

We have several android devices on which we want to sync with one designated android device over wifi without using the syncgateway. We read about the P2P capabilities of couchbase lite for android, especially the feature "Off-the-grid peer-to-peer replication support via REST APIs" caught our eye. Unfortunately we couldn't find any documentation concerning this topic.

We don’t have any examples that implement P2P sync. Couchbase Lite supports syncing with any other instance if you can provide a URL (i.e. IP address, port and database name) for it, but there’s a lot of extra work necessary to get to that point — you need a discovery system to locate other peers, and if you’re not on the same LAN you’ll need a way to get through NATs and firewalls to establish a connection. We don’t provide any of that in 1.0, but it’s an area we’re very interested in and hope to grow into.

I know there are some developers on this list who are working on P2P technologies based on CBL; anyone want to speak up?

—Jens

Yaron Goland

unread,
Jun 3, 2014, 1:18:06 PM6/3/14
to mobile-c...@googlegroups.com

So I'm one of those developers and we currently run our code in the configuration discussed below for our demo. We have a single 'hub' device that all the other devices 'spoke' off of. You can see more gory details here.


Note that we do intend to switch from hub and spoke to a mesh configuration. But the code we are using (PPNET) is currently designed for hub and spoke.


For now 'discovery' consists of typing in IP addresses. But we are in the middle of bringing up our new infrastructure which allows users to share identities (which in our case are public keys) via QR Codes. We are also adding in Tor hidden service support so devices can be discovered anywhere and reached behind firewalls and NATs. We will also eventually put in support for dynamic local discovery (e.g. mDNS/bonjour and/or UPnP/SSDP) but that's really intended for ad-hoc networking scenarios.


Everything we are doing is completely open source so we are happy to share. We are an experiment to see what it would take to build a platform to enable peer to peer apps. You can learn more at https://thali.codeplex.com.


As I mentioned in a separate email we do hope to get many of the changes we had to make to Couchbase to get it work well in a P2P environment moved back into the main Couchbase code base. This is something we are talking to the Couchbase team about.


    Thanks,


            Yaron



From: mobile-c...@googlegroups.com <mobile-c...@googlegroups.com> on behalf of Jens Alfke <je...@couchbase.com>
Sent: Tuesday, June 03, 2014 9:47 AM
To: mobile-c...@googlegroups.com
Subject: Re: working example of P2P sync on android
 
--
You received this message because you are subscribed to the Google Groups "Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mobile-couchba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/86B42311-3C10-4414-B1D9-16FBAAD470D2%40couchbase.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages