Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Heroku Engineering 4 min read Announcement easyNovice

Optimizing Data Reliability: Heroku Connect & Drift Detection

Heroku Connect syncs Salesforce data into Postgres by polling time windows, and long-running Salesforce transactions that commit after the window has moved can be missed, causing drift. A secondary poll re-runs the same poll bounds later to catch those changes. For Bulk API polls it now creates one bulk job per primary job, with a batch per primary batch, instead of many jobs. It also caps how many secondary tasks run at once, which reduces load on the Salesforce org and leaves more Postgres connections free for customer applications.

Related posts

  • A 15-Second Health Check for Your Heroku Connect Data Pipeline

    Heroku Engineering mediumAdept

    The `heroku connect:diagnose` command in the Heroku Connect CLI plugin audits a Salesforce-to-Heroku Postgres sync and reports GREEN/YELLOW/RED status for connection-level checks (API version, permissions, database plan) and mapping/field checks (unique identifiers, binary and calculated fields, schema drift). Common warnings have concrete fixes: recreate the connection or file a support ticket for an outdated API version, move binary blobs to object storage such as S3 and sync URLs instead, avoid relying on cross-object formula fields that don't bump sync timestamps, and refresh mappings or revert migrations when Salesforce or Postgres schemas drift. Running it before schema changes or migrations is recommended as a proactive sanity check.

  • Building an Enterprise Data Warehouse on Heroku: From Complex ETL to Seamless Salesforce Integration

    Heroku Engineering easyNovice

    Heroku unified Salesforce and 20+ internal app databases into a warehouse processing over 10 TB monthly, using Heroku Connect to replicate Salesforce data without API limits and Postgres follower databases to read app data without loading production. Heroku Postgres serves real-time operational analytics and staging, Redshift holds historical data, and Airflow runs 30+ DAGs and 200+ JSON-defined jobs built from Python templates for incremental, bulk and date-range loads. A 5-minute monitoring DAG checks and retries 12 regional Connect instances. Claimed results include 99.99% pipeline uptime, sub-minute freshness, 90% less transfer from incremental loads and 60% lower integration cost, though the piece leans heavily on product promotion.

  • Keep the monolith, but split the workloads

    incident.io mediumAdept

    A Go monolith can get much of the reliability isolation of microservices by splitting workloads into separate deployments of the same binary, instead of breaking it into services. After a bad Pub/Sub message caused an unhandled panic that crashed the web, worker and cron threads together for 32 minutes, incident.io split them into independent Heroku dyno tiers selected by command-line flags. They also gave each class of work its own capped Postgres connection pool and statement timeout, so low-priority jobs such as BigQuery event export or best-effort nudges fall behind rather than exhausting the shared database. The main migration hazard is code that assumes a shared process, such as process-local caches, and the fix is to move that coordination into Postgres or Redis.

  • Scaling SaaS security: Reco’s migration from Postgres to ClickHouse Cloud

    ClickHouse mediumAdept

    Reco, a SaaS security platform ingesting 10-12 billion JSON events weekly, moved over 90% of its workload from Postgres to ClickHouse Cloud. Running both databases synced via CDC had made schema migrations, updates, deletes and VACUUM painful. Reco replaced RDBMS features with ReplacingMergeTree and CollapsingMergeTree for upserts and deletes, idempotency and eventual consistency instead of transactions, and tenant-level atomic materialized view refreshes via REPLACE PARTITION. Further gains came from compute-compute separation, spill-to-disk settings, parallel_distributed_insert_select=2 (cutting resource needs by a third) and data-skipping indexes, plus using the EmbeddedRocksDB engine as a streaming state store in place of Spark state and Redis.

  • Evolving the Backend Storage for Platform Metrics

    Heroku Engineering mediumAdept

    Heroku migrated the time-series store behind MetaaS, its internal metrics service, from self-managed Apache Cassandra to AWS DynamoDB without user-visible impact. MetaaS ingests a couple hundred thousand observations per second into Kafka and aggregates them with stream-processing jobs, writing tens of thousands of points per second to the database. The migration used parallel dual-writes from Kafka and GitHub Scientist-style shadow reads, ramped to 100% of traffic, to catch edge cases. TTL-based retention meant no data backfill was needed: they waited for old Cassandra data to expire, then incrementally cut reads over. p99 query latency dropped from a variable 20–80 ms to a steady 15 ms, and costs fell.

The quest for software engineering knowledge.

Look:
Layout: