Re: Sending notifications from the master to the standby - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Sending notifications from the master to the standby
Date
Msg-id 29168.1326325088@sss.pgh.pa.us
Whole thread Raw
In response to Re: Sending notifications from the master to the standby  (Josh Berkus <josh@agliodbs.com>)
Responses Re: Sending notifications from the master to the standby
Re: Sending notifications from the master to the standby
List pgsql-hackers
Josh Berkus <josh@agliodbs.com> writes:
>> BTW ... it occurs to me to ask whether we really have a solid use-case
>> for having listeners attached to slave servers.  I have personally never
>> seen an application for LISTEN/NOTIFY in which the listeners were
>> entirely read-only.  Even if there are one or two cases out there, it's
>> not clear to me that supporting it is worth the extra complexity that
>> seems to be needed.

> The basic idea is that if we can replicate LISTENs, then you can use
> replication as a simple distributed (and lossy) queueing system.

Well, this is exactly what I don't believe.  A queueing system requires
that recipients be able to remove things from the queue.  You can't do
that on a slave server, because you can't make any change in the
database that would be visible to other users.

> The obvious first use case for this is for cache invalidation.

Yeah, upthread Simon pointed out that propagating notifies would be
useful for flushing caches in applications that watch the database in a
read-only fashion.  I grant that such a use-case is technically possible
within the limitations of a slave server; I'm just dubious that it's a
sufficiently attractive use-case to justify the complexity and future
maintenance costs of the sort of designs we are talking about.  Or in
other words: so far, cache invalidation is not the "first" use-case,
it's the ONLY POSSIBLE use-case.  That's not useful enough.
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Remembering bug #6123
Next
From: Josh Berkus
Date:
Subject: Re: Sending notifications from the master to the standby