How to Define YAML for Incremental Data Updates in ETL Pipelines
Published:
Overview
Incremental data updates in Bold BI are achieved by combining:
- Bold Data Hub pipelines (YAML configuration) for extracting only new or modified records.
- Bold BI Incremental Refresh for efficiently updating datasets used by dashboards and reports.
This article explains how to configure both components to support incremental loading while preventing duplicate records.
Prerequisites
Before configuring incremental loading, ensure the source table contains:
- A unique primary key column (for example, ticketid)
- A column that can identify newly added or modified records (for example, LastUpdatedOn)
Steps to Configure Incremental Updates
1. Create a Pipeline in Bold Data Hub
- Navigate to Data Hub.
- Click Add Pipeline.
- Upload or configure the YAML connector file.
- Save the pipeline.
2. Configure Incremental Extraction in YAML
Add the following metadata configuration for the table:
tables:
- name: ozono
replication_method: INCREMENTAL
replication_key: LastUpdatedOn
replication_value: '2023-01-01 00:00:00'
primaryKeys:
- device_id
- LastUpdatedOn
Configuration Details
| Setting | Description |
|---|---|
| replication_method: INCREMENTAL | Extracts only newly added records after each run. |
| replication_key | Date/time column used to identify new or modified records. |
| primary_key | Unique identifier used to detect duplicate records. |
Note: Incremental extraction retrieves only new records based on the replication key. Updating existing records is not supported through the incremental extraction process alone.
3. Configure Target Load Behavior
To prevent duplicate records, configure the destination to use an appropriate load method.
load_method: upsert
Why Use Upsert?
- New records are inserted.
- Existing records with matching primary keys are updated.
- Duplicate records are prevented when supported by the destination system.
4. Enable Incremental Refresh in Bold BI
After the pipeline creates the associated data source:
- Open the generated data source.
- Enable Incremental Refresh.
- Select the last-modified or tracking column.
- Optionally configure unique identifier columns.
- Save the changes.
5. Schedule and Run the Pipeline
- Configure a schedule in Bold Data Hub.
- Run the pipeline manually or wait for the scheduled execution.
- Monitor the execution logs for successful completion.
6. Validate the Results
After the pipeline completes:
- Insert a new record in the source table and run the pipeline again.
Expected behavior:
- New records should be added to the destination.
- Existing records should not be duplicated.
- Record counts should remain consistent across executions.
Important Concepts
Incremental Extraction
Incremental extraction is controlled by:
- replication_method
- replication_key
The system automatically maintains a checkpoint value after each successful execution and uses it during subsequent runs.
Important
replication_key controls which records are extracted.
It does not prevent duplicate records by itself.
Duplicate Prevention
- To avoid duplicate records:
YAML
metadata:
<table_name>:
primary_key: ticketid
Always configure:
- A valid primary_key
- An upsert-based load strategy (when supported)
- A destination table with appropriate key constraints
Best Practices
- Define a primary key for every table.
- Use incremental extraction whenever possible.
- Configure an upsert load strategy to handle existing records.
- Ensure the replication key contains increasing or updated values.
- Validate record counts after each execution.
- Follow correct YAML syntax and indentation.
Expected Outcome
- After proper configuration: New records are extracted incrementally.
- Existing records are not duplicated.
- Pipeline execution remains efficient and scalable.
- Incremental refresh processes only required data.