3 ms·
> Unfortunately it isn't correct that you don't need a separate MQ. Postgres DB connections are not cheap That depends on your app size. If you're building som
by sehrope 13y ago
> Unfortunately it isn't correct that you don't need a separate MQ. Postgres DB connections are not cheap
That depends on your app size. If you're building something relatively small then having a few additional DB connections vs a dedicated MQ server can be worth it (it's really just extra shared memory for the connection). I do agree though that most folks are better off just using a real MQ server. For anything larger (both app size and app scale) it ends up being much better.
> ... the best way to use this pattern is to have a single server listening to PG notifications and publish them to a real MQ.
Another approach I've been looking at is creating a writable FDW[1] that bridges to an MQ system. That combined with a PG background worker[2] to listen for notifications gives you a transactional system that starts/stop with your database.
[1]: http://wiki.postgresql.org/wiki/Foreign_data_wrappers http://wiki.postgresql.org/wiki/Foreign_data_wrappers
[2]: http://www.postgresql.org/docs/9.3/static/bgworker.html http://www.postgresql.org/docs/9.3/static/bgworker.html
- ibotty 13y agothat sounds great. be sure to write about it when you (or someone else) implements it!