Re: Use LISTEN/NOTIFY between different databases

From: Marko Kreen <markokr(at)gmail(dot)com>
To: Igor <igorya(dot)inscriptio(at)gmail(dot)com>
Cc: PostgreSQL <pgsql-general(at)postgresql(dot)org>
Subject: Re: Use LISTEN/NOTIFY between different databases
Date: 2012-05-09 11:24:55
Message-ID: CACMqXC+aoyFG_FnaHaa6ABSNsbp6SFZ9i5e56fMnACEUwH8iXg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, May 7, 2012 at 11:52 PM, John R Pierce <pierce(at)hogranch(dot)com> wrote:
>> 2012/5/7 John R Pierce <pierce(at)hogranch(dot)com <mailto:pierce(at)hogranch(dot)com>>
>>    On 05/07/12 1:13 PM, Igor wrote:
>> I understand this. But I need "link" between two clients, connected to
>> different databases.
>>
>> Its real situation. We use sharded cluster based on plproxy. The calling
>> function for DB queries is equal in all databases (see plproxy
>> documentation). Now we need to release some internal logic between clients
>> based on certain events which occurred in this functions. The LISTEN/NOTIFY
>> mechanism is very good feature, but event occur NOT in connected DB - i.e.
>> in destination DB via plproxy wrapper. I.e. wee need subject.

1) Install PL/Proxy functions into shard.
+ Synchronous - remote call is launched instantly
- Messy - creates complex dependencies between dbs.
- Non-transactional (remote call may commit, but local call may not)
- Not good idea if high transaction rate is expected
(Adds network latency to each call, many new connections)

2) Use PgQ ( http://wiki.postgresql.org/wiki/PGQ_Tutorial )
+ Good for high loads as it does batch-processing
+ Transactional
- Asynchronous

--
marko

In response to

Browse pgsql-general by date

  From Date Subject
Next Message PostgreSQL Magazine 2012-05-09 12:02:47 PostgreSQL Magazine #01 is out !
Previous Message Chris Angelico 2012-05-09 06:00:57 Re: Seeking performance advice: Index for "recent entries"