---
title: "Optimizing Data Reliability: Heroku Connect & Drift Detection"
description: "Heroku Connect syncs Salesforce data with Heroku Postgres, but primary polling can miss changes when long-running Salesforce automations commit after the polling window advances, creating drift. The service uses secondary polls over the same bounds as primary polls to find and repair missed changes, with Bulk API or SOAP API selected according to dataset size and retries for failed polls. Recent improvements change Bulk API drift handling by creating one secondary bulk job for each primary bulk job, then adding corresponding batches instead of creating many jobs. Secondary tasks are now scheduled and executed with limited concurrency, reducing simultaneous database connections consumed while Postgres is updated and preserving capacity for applications. The post says these changes reduce load on Salesforce and improve operational reliability during heavy synchronization, while noting that Heroku Connect remains asynchronous rather than truly real-time."
---

# Optimizing Data Reliability: Heroku Connect & Drift Detection

[Heroku](https://yomu.fyi/company/heroku) · Siraj Ghaffar · Jun 26, 2024

**Type:** Explainer

## Summary

Heroku Connect syncs Salesforce data with Heroku Postgres, but primary polling can miss changes when long-running Salesforce automations commit after the polling window advances, creating drift. The service uses secondary polls over the same bounds as primary polls to find and repair missed changes, with Bulk API or SOAP API selected according to dataset size and retries for failed polls. Recent improvements change Bulk API drift handling by creating one secondary bulk job for each primary bulk job, then adding corresponding batches instead of creating many jobs. Secondary tasks are now scheduled and executed with limited concurrency, reducing simultaneous database connections consumed while Postgres is updated and preserving capacity for applications. The post says these changes reduce load on Salesforce and improve operational reliability during heavy synchronization, while noting that Heroku Connect remains asynchronous rather than truly real-time.

## Context

Primary polling can miss Salesforce changes when long-running automations commit after the polling window has advanced. These missed transactions create drift between Salesforce and Heroku Postgres, while unrestricted secondary polling can create many Salesforce bulk jobs and consume database connections needed by applications.

## Approach / What changed

Heroku Connect tracks primary poll bounds and uses secondary polls to detect and repair missed changes. For Bulk API synchronization, it now creates one secondary bulk job per primary bulk job, adds corresponding batches, and limits the scheduling and concurrent execution of secondary poll tasks.

## Takeaways

- Secondary polls reuse the primary poll bounds to catch Salesforce changes that the initial poll missed.
- For Bulk API drift detection, one secondary bulk job is created for each primary bulk job, with secondary batches corresponding to primary batches.
- Limiting concurrent secondary poll tasks reduces database connections used during synchronization and leaves more connections available to applications.

**Tags:** [Heroku Connect](https://yomu.fyi/topic/heroku-connect), [Postgres](https://yomu.fyi/topic/postgres), [Reliability](https://yomu.fyi/topic/reliability)

- Source: [Heroku](https://www.heroku.com/blog/optimizing-data-reliability-heroku-connect-drift-detection)
- Source URL: https://www.heroku.com/blog/optimizing-data-reliability-heroku-connect-drift-detection
- Ingested by Yomu: 2026-09-10T00:02:16.846Z

[Read original post](https://www.heroku.com/blog/optimizing-data-reliability-heroku-connect-drift-detection)
