postgresqlherokusalesforceheroku-postgresheroku-connect

Heroku Connect, detect salesforce update in postgres


So I have an app taking advantages of Heroku Connect to sync datas between platforms. I need to find a way to detect when an update has been made by Salesforce (or at least, when the sync has been executed). I'm using sequelize in nodejs, but of course the hooks don't work since heroku connect works directly on the DB and doesn't use the ORM. So I'm wondering what are my options here.


Solution

  • The solutions that come to my mind (likely there are more):

    1. check out the Heroku Connect system tables like _trigger_log. This table will give you an exact log of the actions HC took (updates/insert/deletes) with information about the record. Yes, you would need to poll it :)

    2. Postgres brings it's own queue-system with LISTEN and NOTIFY. You an write your own database-trigger that will react on change in the salesforce tables, and have a listening/worker-process on the LISTEN queue in PostgreSQL.