Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql General > Inter-app commu...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 3 Topic 15859 of 17437
Post > Topic >>

Inter-app communication via DB

by wizzardx@[EMAIL PROTECTED] (David) Jun 19, 2008 at 11:09 AM

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 tem****arily 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@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
 




 3 Posts in Topic:
Inter-app communication via DB
wizzardx@[EMAIL PROTECTED  2008-06-19 11:09:12 
Re: Inter-app communication via DB
Karsten.Hilbert@[EMAIL PR  2008-06-19 12:26:09 
Re: Inter-app communication via DB
dfontaine@[EMAIL PROTECTE  2008-06-19 15:21:07 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Nov 22 16:24:07 CST 2008.