Localhost vs. Unix Domain Sockets?

From: Ken Tanzer <ken(dot)tanzer(at)gmail(dot)com>
To: PG-General Mailing List <pgsql-general(at)postgresql(dot)org>
Subject: Localhost vs. Unix Domain Sockets?
Date: 2014-08-18 23:55:28
Message-ID: CAD3a31U19TwGg1FBksCUOqE1gNJidPcu1i7hm+dU8nAfB+d-Zw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi. I'm working with a couple of machines that have Postgres/Apache on
Linux setups. Connections to Postgres are currntly TCP/IP to localhost.
(We're also using itk, so that the apache connections are per-user.) We
began looking into about encrypting these connections with SSL, but now I'm
thinking of using unix domain socket connections instead.

I see two possible benefits to this:

1) Maybe better performance or use of resources. I didn't find a lot of
info, although this post from Bruce Momjian indicates that is is the case:
http://momjian.us/main/blogs/pgblog/2012.html#June_6_2012.

2) Our webapp and users wouldn't need to be given a Postgres password at
all. Authenticating as their user would be sufficient.

So I've got two questions. One is whether there are any downsides to using
sockets, or any "gotchas" to be aware of. The second is whether there is
anything to do to increase the security of sockets? (e.g., analagous to
encrypting localhost conenctions with SSL?) From the little I saw, it
sounds like sockets are "just inherently secure," but wanted to confirm
that or get another opinion!

Thanks in advance,

Ken

--
AGENCY Software
A Free Software data system
By and for non-profits
*http://agency-software.org/ <http://agency-software.org/>*
*https://agency-software.org/demo/client
<https://agency-software.org/demo/client>*
ken(dot)tanzer(at)agency-software(dot)org
(253) 245-3801

Subscribe to the mailing list
<agency-general-request(at)lists(dot)sourceforge(dot)net?body=subscribe> to
learn more about AGENCY or
follow the discussion.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message John R Pierce 2014-08-19 00:00:36 Re: Localhost vs. Unix Domain Sockets?
Previous Message Michael Shepanski 2014-08-18 22:43:30 New wrapper library: QUINCE