Re: Inter-app communication via DB - Mailing list pgsql-general

From Pavel Stehule
Subject Re: Inter-app communication via DB
Date
Msg-id 162867790806190227uf1a388ejf0e07906bc85b8cf@mail.gmail.com
Whole thread Raw
In response to Inter-app communication via DB  (David <wizzardx@gmail.com>)
List pgsql-general
hello

look to orafce package
http://www.pgsql.cz/index.php/Oracle_functionality_%28en%29



regards
Pavel


2008/6/19 David <wizzardx@gmail.com>:
> Hi list.
>
> One pattern I've used is for apps to communicate events to each other
> through the database.
>
> ie:
>
> - App 1 sents a boolean value to True
> - App 2 queries the field every 10s, sets the value to False, and does
> something.
>
> Is this reasonable, or should apps avoid this pattern?
>
> I have seen the NOTIFY and LISTEN SQL statements. However:
>
> 1) App 2 might not be running at the time (eg: it's launched from
> cron, or it was temporarily stopped), and the expectation is that App
> 2 will run the special logic when it is started.
>
> 2) App 2 is usually single-threaded, and needs to do other things in
> it's main thread besides wait for a DB notification.
>
> I also know of RPC, but haven't used it before, and don't see a need
> if you can use the above pattern.
>
> I would use RPC (or unix signals if on the same host) if App 2 needed
> to respond quickly, and I didn't want to hammer the DB & network with
> constant polling.
>
> Any comments?
>
> David.
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

pgsql-general by date:

Previous
From: Karsten Hilbert
Date:
Subject: Re: Inter-app communication via DB
Next
From: David
Date:
Subject: Re: Inter-app communication via DB