This is as days pass by, by Stuart Langridge

And this is Why not to use domain sockets for a desktop CouchDB, written , and concerning CouchDB

The obvious idea that pops into everyone's head, including mine, when talking about having a running CouchDB that's specific to me is: why use TCP for it? Why not just use a unix domain socket? Then you don't have to worry about other people on the same machine trying to access it. Everyone thinks this, and on balance it's not the way to go. This is why.
  1. You can't browse to a unix domain socket in your web browser. This, by itself, is enough to kill the idea for me. I genuinely love the idea that applications store their data and then I can see that data in my browser using Futon, the CouchDB web UI. I can edit that data. That's fantastic. Using unix sockets would break that.
  2. One other nice thing about CouchDB is that you can do replication between two different databases; I like this because I can have the same data on my laptop and my netbook if I want. That doesn't work if you use domain sockets, because the two CouchDBs can't see one another.
  3. As far as I can tell, Mochiweb, the underlying Erlang HTTP library that Couch uses, doesn't do domain sockets anyway. (Obviously fixing this is only a Small Matter Of Programming.)
This has been a public service broadcast on behalf of the Write These Reasons Down So I Have Them To Hand Next Time Someone Suggests Unix Domain Sockets party.

Comments

Chris Jones

Other than reason 3, this doesn't sound like something that couldn't be solved with a thin shim that talked to the unix socket and a TCP socket (which would also mean your network sharing component was trivial to enable/disable, instead of having to bounce the couchdb daemon)

sil

Chris: well, possibly, but what's the point? If you're going to run a daemon which talks to the domain socket and runs all the time, then you're not solving any of the problems that were the motivation for using domain sockets in the first place.

mhi

sil: As I understood the first comment the idea was that CouchDB would normally use just domain sockets. Only if you wanted 1. or 2. you would enable the "network sharing component" which would talk to the unix socket and "publish" it on a TCP socket.

sil

mhi: yeah, but I want 1 all the time, which means that the "publisher" would be running all the time, at which point there might as well not be a publisher :)

as days pass by, by Stuart Langridge — Why not to use domain … | WEBMASTERLIB.COM

[...] at HERE Related PostsDivine Power Excerpts: Destruction DomainGet Google and Alexa rank of a domain [...]

Chris Jones

As a user I never want 1. As a paranoid type I want to be able to control 2 trivially and preferrably automagically :)

Claes

If anyone could clarfiy for me why http over domain sockets is not a good thing, I would be very grateful. I think it would be great for cases like this, but have found very very few traces of this ever being discussed.

converter

"Don't ask me why I'm smiling I just woke up and the best part of waking up is folgers in your cup" LOL

Michael E

Reason #42: most HTTP client libraries won't know what to do with a domain socket. Thus making development more tedious/cumbersome, as any platform will likely first need its HTTP library modified to support some kind of URL specifying a domain socket before it can be used as a CouchDB client.

This website belongs to Stuart Langridge. Contact details are available. Don't eat yellow snow. Valid HTML5, at least in theory, except for the bits that aren't because I'm that futuristic that I'm ahead of the spec, oh yes. HTML5 help from Bruce Lawson, among others. Fonts from the superb FontSquirrel. End.