Replication without CDC: up to 99% less ingestion
A replication engine that finds changed rows on sources with no native CDC, using hierarchical hashing to land Fivetran-format SCD2 history in Snowflake instead of reloading everything each cycle.
Context
An aviation client wanted to replace an existing Fivetran ingestion workflow with Snowflake Openflow. Some of its PostgreSQL sources had no usable log-based change data capture, the gap Fivetran covers with its Teleport Sync feature, so the replacement needed a comparable way to replicate incrementally.
The initial proposal was to copy the entire source dataset into Snowflake on every cycle and work out the changes there, repeatedly transferring and processing rows that had not changed. The replacement also had to keep Fivetran’s column naming and SCD2 history conventions, so downstream pipelines would not need to change.
This is the hardest engineering problem I have worked on: detect change efficiently when the source will not tell you what changed.
My role and ownership
I proposed the alternative to full-copy ingestion, then architected and built the engine. I owned the change-detection design and the Snowflake-side history application, and worked with senior engineers to harden its concurrency and cluster behaviour.
Technical approach
- Designed a Merkle-style hierarchical hashing engine on Apache NiFi (Openflow). It hashes the source in tiers (super-block, then block, then row) and drills only into regions whose hash changed, identifying inserts, updates and deletes without CDC logs.
- After the initial load, only changed records move. Snowflake stored procedures, Streams, Task DAGs and Snowpipe Streaming apply them as Fivetran-compatible SCD2 history.
- Built it as a reusable, configuration-led integration for PostgreSQL sources, with a Streamlit control interface.
- Hardened it for multi-node execution with senior engineers:
- Root-caused a cluster scheduling bug where triggers fired on every node, duplicating sync cycles and breaking merges, and pinned trigger execution to the primary node.
- Made merges idempotent and duplicate-safe, and added a single-flight cycle lock with stale self-heal so overlapping runs could not corrupt state.
Tradeoffs
Hierarchical hashing spends some work up front hashing the source to avoid moving data that has not changed, which is the right trade for large, mostly static sources. The harder tradeoffs were about correctness under concurrency: I chose strict idempotency and a single-flight lock over raw throughput, because a replication engine that is occasionally wrong is worse than one that is slightly slower.
Outcome
In validation against a live PostgreSQL source, the engine found the one changed row among 1,000 with no false positives. Moving that single row instead of all 1,000 means up to 99% less incremental row ingestion in low-change conditions than the proposed full reload.
The engine proved feasibility end to end and was adopted, with production rollout underway.
Reflection
The cluster bug was the sharpest lesson: a scheduler that behaves correctly on one node can be silently catastrophic across a cluster. It pushed me to treat idempotency and single-flight execution as first-class requirements rather than afterthoughts. If I took it further, I would add automated failover tests to prove the concurrency guarantees continuously, not just at validation time.