---
title: "Heroku Connect: Event-driven Data Sync For Force.com"
description: "Heroku Connect synchronizes data in both directions between Salesforce (Force.com) and Heroku Postgres, but its original polling design trades simplicity and reliability for synchronization latency, wasted API calls, and unnecessary database queries. The post presents an event-driven alternative using the Force.com Streaming API and PostgreSQL’s LISTEN/NOTIFY system. For Salesforce, Heroku Connect automatically creates a PushTopic per synchronized table, subscribes with Node.js and NForce, and dispatches Redis tasks when notifications arrive. Those events act as change signals rather than complete data transfers: workers query the Force.com SOAP API because streaming has limitations and subscribers may miss events. On Postgres, PL/pgSQL trigger functions call pg_notify after DML, while node-postgres listens on named channels; the system supports added UPDATE and DELETE triggers, though triggers are still required."
---

# Heroku Connect: Event-driven Data Sync For Force.com

[Heroku](https://yomu.fyi/company/heroku) · Scott Persinger · Jul 17, 2014

**Type:** Problem & solution

## Summary

Heroku Connect synchronizes data in both directions between Salesforce (Force.com) and Heroku Postgres, but its original polling design trades simplicity and reliability for synchronization latency, wasted API calls, and unnecessary database queries. The post presents an event-driven alternative using the Force.com Streaming API and PostgreSQL’s LISTEN/NOTIFY system. For Salesforce, Heroku Connect automatically creates a PushTopic per synchronized table, subscribes with Node.js and NForce, and dispatches Redis tasks when notifications arrive. Those events act as change signals rather than complete data transfers: workers query the Force.com SOAP API because streaming has limitations and subscribers may miss events. On Postgres, PL/pgSQL trigger functions call pg\_notify after DML, while node-postgres listens on named channels; the system supports added UPDATE and DELETE triggers, though triggers are still required.

## Context

Heroku Connect originally used polling to detect changes between Salesforce and Heroku Postgres. Although polling was considered simple and reliable, it caused high synchronization latency or wasted API calls and database queries, depending on the polling interval.

## Approach / What changed

The design uses Force.com Streaming API PushTopics as change notifications for Salesforce and PostgreSQL LISTEN/NOTIFY for database events. Node.js subscribers process notifications, Redis dispatches synchronization tasks, workers query the Force.com SOAP API for current data, and PL/pgSQL triggers publish Postgres changes through named channels.

## Takeaways

- Force.com PushTopics are generated automatically from the synchronized table and configured to notify on create, update, and delete operations.
- Streaming notifications are used as signals to query current data through the Force.com SOAP API because event payloads have limitations and subscribers can miss events while offline.
- Postgres LISTEN/NOTIFY requires database-side publishing logic; PL/pgSQL triggers call pg\_notify, while node-postgres registers notification handlers and subscribes to channels.

**Tags:** [Node.js](https://yomu.fyi/topic/node-js), [Postgres](https://yomu.fyi/topic/postgres), [Salesforce](https://yomu.fyi/topic/salesforce)

- Source: [Heroku](https://www.heroku.com/blog/sf-streaming-api)
- Source URL: https://www.heroku.com/blog/sf-streaming-api
- Ingested by Yomu: 2026-09-09T14:23:06.042Z

[Read original post](https://www.heroku.com/blog/sf-streaming-api)
