Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 34607 invoked from network); 9 Apr 2011 07:19:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 9 Apr 2011 07:19:24 -0000 Received: (qmail 18043 invoked by uid 500); 9 Apr 2011 07:19:22 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 18008 invoked by uid 500); 9 Apr 2011 07:19:22 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 18000 invoked by uid 99); 9 Apr 2011 07:19:22 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 09 Apr 2011 07:19:22 +0000 X-ASF-Spam-Status: No, hits=2.9 required=5.0 tests=FS_REPLICA,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of dave@muse.net.nz designates 209.85.160.180 as permitted sender) Received: from [209.85.160.180] (HELO mail-gy0-f180.google.com) (209.85.160.180) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 09 Apr 2011 07:19:16 +0000 Received: by gyf2 with SMTP id 2so3128915gyf.11 for ; Sat, 09 Apr 2011 00:18:55 -0700 (PDT) MIME-Version: 1.0 Received: by 10.236.191.10 with SMTP id f10mr3968071yhn.180.1302333535057; Sat, 09 Apr 2011 00:18:55 -0700 (PDT) Received: by 10.236.103.173 with HTTP; Sat, 9 Apr 2011 00:18:54 -0700 (PDT) X-Originating-IP: [125.236.236.206] In-Reply-To: References: Date: Sat, 9 Apr 2011 19:18:54 +1200 Message-ID: Subject: Re: Peer-to-Peer Replication From: Dave Cottlehuber To: user@couchdb.apache.org Cc: Chris Anderson , Andrew Tunnell-Jones Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org On 9 April 2011 19:14, Chris Anderson wrote: > I heard from one experienced iOS dev, that the best way to > interconnect locally is in GameKit. > > Chris > > On Fri, Apr 8, 2011 at 11:22 AM, Andrew Tunnell-Jones w= rote: >> I've been pondering a subset of this problem as I want to implement >> opportunistic replication. I'd like to use DNS Service Discovery >> (often referred to as ZeroConf) and I've already written an Erlang >> interface to Apple's Bonjour DNSSD API[1] which works on OS X and >> Linux via Avahi's compatibility layer. The code should be portable to >> Windows but I've not gone there yet. >> >> Slight digression - Apple Bonjour on OS X and Windows can be >> configured to advertise and browse services over the internet (it'll >> setup a port forward via NAT-PMP or uPnP if needed/available) via any >> DNS server which supports DNS Update and has an appropriately >> configured zone[2], though it works a lot better if the server >> implements Apple's extensions for real-time updates (DNS-LLQ) and >> automatic record expiration (DNS-UL). (I've written a CouchDB backed >> one that does[3].) Avahi's wide-area support is read-only, though >> their trac install indicates write support is slated for 0.7[4]. >> >> Back to CouchDB - I haven't worked out the exact mechanics but I'd >> like to do something along the lines of starting an SSL mochiweb >> listener and then advertising it using the hash of the SSL cert >> (self-signed or otherwise) as the service name. As part of the service >> advertisement, a user-friendly text identifier would be included that >> can be arbitrarily changed (as the cert hash is the real identifier). >> The SSL transport would require mutual acceptance of certificates >> which would be configured by POST'ing a hash to a particular URL. A >> list of services (hashes) and further information on a given service >> (including the friendly identifier) would be retrievable via other >> URLs. Replication would be configured in a similar manner to >> _replicator with schema being dropped from target/source URLs and a >> peers hash being used in place of a hostname. Continuous replication >> would be persisted between restarts and then setup and torn down as >> services appear and disappear. >> >> Keeping in mind this is mostly conjecture at this point, any thoughts? >> >> Andrew >> >> 1. https://github.com/andrewtj/dnssd_erlang >> 2. http://dns-sd.org/ServerSetup.html (dated) >> 3. https://github.com/andrewtj/dnsxd >> 4. http://avahi.org/milestone/Avahi%200.7 >> >>> From:=A0Ryan Ramage >>> To:=A0user@couchdb.apache.org >>> Date:=A0Thu, 7 Apr 2011 09:40:48 -0600 >>> Subject:=A0Re: Peer-to-Peer Replication >>> I think we are missing the issue. We do all agree that couch is great >>> at replicating when it has been wired up with src and dest urls. >>> >>> The issue is more around creating a distributed graph management to >>> handle nodes (couches) in a peer to peer manner. I don't think this >>> space has been really explored. >>> >>> For a local network, there are lots of service discovery protocols >>> that you could use, something like >>> http://en.wikipedia.org/wiki/Zero_configuration_networking or >>> http://en.wikipedia.org/wiki/Universal_Plug_and_Play >>> but of course this would be outside of what couch does. I think >>> BigCouch may have something like that built in, but someone from >>> Cloudant would have to confirm. >>> >>> For a more p2p system, this is a much harder problem. For one, you >>> mentioned the network ports. If you are imagining average people using >>> this, then you would have to deal with managing port forwarding using >>> Internet Gateway Device Protocol. At least one couch on the end of a >>> replication would have to be able to be accessed by http through a >>> router. You would want a user friendly way to do this. >>> >>> Next is managing the graph. This is hard. No help from couch again. >>> Nodes going up and down, etc. >>> >>> It would be fun to see some work done on this. For extra points it >>> would be cool if it where done in erlang and could be contributed into >>> the couch core :) >>> >>> Ryan >>> >>> >>> >>> >> > > > > -- > Chris Anderson > http://jchrisa.net > http://couchbase.com > Is there an advantage in using an erlang-based discovery rather than iOS library - surely linking up with any nearby couch is preferred? A+ Dave