Heroku Connect,检测 postgres 中的 salesforce 更新

Heroku Connect, detect salesforce update in postgres

所以我有一个应用程序利用 Heroku Connect 在平台之间同步数据。 我需要找到一种方法来检测 Salesforce 何时进行了更新(或者至少,何时执行了同步)。我在 nodejs 中使用 sequelize,但是挂钩当然不起作用,因为 heroku connect 直接在 DB 上工作并且不使用 ORM。 所以我想知道我在这里有什么选择。

我想到的解决方案(可能还有更多):

  1. 查看 Heroku Connect system tables 喜欢 _trigger_log。此 table 将为您提供 HC 采取的操作的准确日志 (updates/insert/deletes) 以及有关记录的信息。是的,您需要对其进行投票:)

  2. Postgres 使用 LISTENNOTIFY 带来了它自己的队列系统。您可以编写自己的数据库触发器,它将对销售人员 table 的变化做出反应,并在 PostgreSQL 的 LISTEN 队列上有一个 listening/worker-process。