couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Tunnell-Jones <>
Subject Re: Peer-to-Peer Replication
Date Sat, 23 Apr 2011 01:31:22 GMT
On Sat, Apr 9, 2011 at 8:15 AM, Andrew Tunnell-Jones <> wrote:
> Sending this from a mobile so excuse my brevity -- GameKit is essentially Bonjour + stuff,
Bonjour is just DNSSD (in the protocol sense) which in turn is what Avahi does. Avahi provide
a compatibility wrapper which emulates much of Apples DNSSD API. The Erlang interface I mentioned
wraps the Apple DNSSD API so in theory it'll work on iOS, OS X, Windows and Linux.

I've since ported the Erlang interface[1] to Windows and made an
exploratory 'couch_dnssd'[2] module to get a feel for how things fit
together in CouchDB. The following is a brief outline of what the
module currently does which I'm sharing so that I can get some input
on what it should do. Keep in mind it's just a quick hack and is by no
means complete.

If Couch's httpd is not bound to a loopback address a service is
registered under the type _http._tcp with the subtype _couchdb. The
services name is generated from the user and machine Couch is running
on - eg: "atj's CouchDB on atj-mbp".

As the service is registered under the type _http._tcp DNSSD aware web
browsers (of the big ones, Safari, IE with a plugin and Firefox with
an Extension on OS X/Win) will be able to find the service. For these
browsers, a path parameter of '/_utils/' is specified in the service's
registration so that they'll navigate directly to futon.

Both the path and the service's name can be overridden by specifying
them in local.ini. Browsing and resolving instances is done as

To get a list of instances, issue a GET on '/_dnssd':
$ curl
[{"name":"another couch","domain":"local."},{"name":"another

Add a domain (trailing period optional) to the path to filter the list
to services in that domain:
$ curl
[{"name":"another couch","domain":"local."}]

Finally, add a service name to the path to resolve the hostname and
port of that instance:
$ curl

The above functionality is pretty bare but I'm hoping it's enough to
seed some ideas as to what DNSSD in Couch could be used for. My
interest is primarily in building out opportunistic replication
(replicating whenever connectivity is available) but I'm sure theres
other areas where it could be useful. What functionality would you
like to see available?

— Andrew


View raw message