Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Important
Some or all of this functionality is available as part of a preview release. The content and the functionality are subject to change.
The solution uses different incremental processing strategies optimized for each layer transition:
Bronze to Silver: Watermark-based incremental loading
For ingesting data from source systems into bronze and transforming to silver, the solution uses watermark-based incremental loading:
Salesforce NPSP:
- Uses
SystemModstampfield as watermark to track last modification timestamp - Stores watermark values in
Metadata_Watermarktable in Bronze lakehouse - Only processes records modified since the last watermark
- Performs MERGE operations to update existing records and insert new ones
Dynamics 365:
- Uses custom watermark-based synchronization for data tables
- Tracks last processed timestamp per entity
- Performs full compare-and-sync for option sets (dimension tables)
- Uses MERGE operations with INSERT/UPDATE/DELETE logic
Silver to Gold: Change Data Feed (CDF)
For transforming data from silver to gold layer, the solution uses Delta Lake change data feed (CDF) to capture only records that are inserted, updated, or deleted since the last refresh. The solution processes this delta instead of performing a full data reload, greatly reducing the compute overhead and shortening the processing windows.
ProcessCdfTable function
The ProcessCdfTable function, defined in the Fundraising_Config notebook, processes incremental changes from silver to gold. It uses Delta Lake change data feed (CDF) to identify new or modified rows in a source table and applies those changes to a target table.
This function helps ensure data is updated efficiently through tracking changes, enriching records, and handling updates and inserts (upserts).
Key concepts:
| Concept | Description |
|---|---|
| Change data feed (CDF) | Enables reading only the changed rows (inserts/updates/deletes) from a Delta table since a specific commit version. |
| Commit version tracking | Maintains a record of the last processed _commit_version using the ChangeDataFeedState table. |
| Surrogate key enrichment | Optionally enriches records with dimension keys or other business logic through a user-defined enrich_func. |
| Idempotent merge | Runs a parameterized MERGE INTO SQL template to insert or update the target table with processed data. |
Processing workflow:
Prerequisites:
The source Delta table must have CDF enabled (automatically configured during schema creation):
ALTER TABLE <table_name> SET TBLPROPERTIES (delta.enableChangeDataFeed = true);The
ChangeDataFeedStatetracking table must exist in the target lakehouse (created automatically during setup).
Workflow:
Determine last processed version
The system checks theChangeDataFeedStatetable for the most recent_commit_versionprocessed for a given source/target table pair.Read changes from Delta source
Using Delta LakereadChangeFeedoption, the function reads only new or updated records since the last known version. Delete operations are handled separately.Apply deduplication logic
If multiple updates exist for the same primary key, only the latest change is selected per_commit_version.Optional data enrichment
If the table specifies anenrich_func, the filtered data is passed through this function for dimension lookups or other transformation logic.Run merge logic
The processed snapshot is materialized into a temporary view, and the definedmerge_sql_templateis run to apply the changes to the target table.Update processing state
After successful processing, the function records the most recent commit version to theChangeDataFeedStatetable for future executions.