On Thu, Jul 25, 2013 at 4:41 AM, Some Developer <someukdeveloper@xxxxxxxxx> wrote:
I think another option is to use some sort of pub/sub architecture using a messaging server such as RabbitMQ. It would at least allow you to avoid/reduce the locking in the database caused by the remote calls in triggers. It would also allow you to scale out the app servers instead of scaling up the database. That said, depending on your load, it might be overkill.
You are forgetting that you can execute a query asynchronously using libpq therefore the app server can continue serving requests whilst the database server chugs away on its work. You just poll the server every now and again to see if the work has finished.
I think another option is to use some sort of pub/sub architecture using a messaging server such as RabbitMQ. It would at least allow you to avoid/reduce the locking in the database caused by the remote calls in triggers. It would also allow you to scale out the app servers instead of scaling up the database. That said, depending on your load, it might be overkill.
Sébastien