Sync Modes
Bizon supports three sync modes that determine how data is extracted from sources. Choose the right mode based on your data freshness requirements and source capabilities.
Overview
Section titled “Overview”| Mode | Creates New Job | Resumes From | Best For |
|---|---|---|---|
full_refresh | Yes, every run | Beginning (never resumes) | Small datasets, complete snapshots |
incremental | Yes, unless resuming an interrupted job | Start of the last successful run | Large datasets, append-only data |
stream | No, reuses job | Last committed offset | Real-time data, Kafka/queues |
Full Refresh
Section titled “Full Refresh”Full refresh mode syncs all data from the source on every run.
source: name: hubspot stream: contacts sync_mode: full_refreshHow it works:
- Creates a new StreamJob each run
- Extracts all records from the source
- Continues until pagination is exhausted
- Marks job as SUCCEEDED or FAILED
A full refresh does not resume. If a previous run left its job running (for example a pod killed by its deadline), the next run cancels that job and starts a new one from the beginning. The staging table ({table}_temp on BigQuery) is cleared first, so rows from a crashed attempt are never published. A run that fails leaves the destination table untouched.
Use cases:
- Small to medium datasets where full extraction is fast
- Data that changes unpredictably (no reliable timestamp)
- Initial loads before switching to incremental
- Sources that don’t support incremental queries
Considerations:
- Higher data transfer costs for large datasets
- Longer sync times as data grows
- Destination must handle duplicate/updated records
Incremental
Section titled “Incremental”Incremental mode only syncs new or updated records since the last successful sync.
source: name: hubspot stream: contacts sync_mode: incrementalHow it works:
- Finds the last successful StreamJob for this pipeline, source and stream
- Creates a new StreamJob, or resumes the one an interrupted run left
running - Calls the source’s
get_records_after()with asource_statebuilt from that last successful job - Syncs until pagination is exhausted
- On success, marks the job SUCCEEDED: its start time becomes the next run’s
last_run
If no successful job exists yet, the run fetches the whole stream with get(). An interrupted incremental job is resumed from the cursors already written to the destination.
Incremental State
Section titled “Incremental State”get_records_after() receives a SourceIncrementalState:
| Field | Type | Description |
|---|---|---|
last_run | datetime | Start time (created_at) of the last successful job, timezone-aware UTC |
state | dict | The next_state persisted by the last successful job. {} if none |
run_started_at | datetime | Start time of the current job, UTC, stable across resumes |
cursor_field | string | The source.cursor_field from the config, if set |
run_started_at is exactly the last_run the next run will receive. Using last_run as the lower bound and run_started_at as the upper bound of each run’s window makes consecutive windows tile with no gap or overlap.
A source can persist its own state by returning next_state on a SourceIteration. The last non-null value of a run is saved only if the job succeeds; a run that emits none carries the previous state forward. See Custom Sources.
Use cases:
- Large datasets where full refresh is too slow
- Append-only data (logs, events, transactions)
- APIs with efficient date-filtered queries
- Cost optimization for metered APIs
Requirements:
- Source must implement
get_records_after()method - Source API must support filtering by modification date
- Check stream support with
bizon stream list <source>
Configuration:
source: name: my_api stream: events source_file_path: ./my_api_source.py sync_mode: incremental cursor_field: updated_atConsiderations:
- Relies on source’s timestamp accuracy
- Deleted records may not be captured
- The first run fetches everything; to fetch everything again later, use a stream reset
Stream
Section titled “Stream”Stream mode enables continuous, real-time data ingestion with offset tracking.
source: name: kafka stream: topic sync_mode: streamHow it works:
- Uses a single, persistent RUNNING StreamJob
- Tracks offsets/positions in the source system
- Commits progress periodically to backend
- Runs continuously until stopped
- Resumes from last committed offset on restart
Use cases:
- Real-time data pipelines
- Kafka/Redpanda topic consumption
- Event streaming architectures
- Low-latency data delivery
Configuration:
source: name: kafka stream: topic sync_mode: stream bootstrap_servers: kafka:9092 group_id: my-consumer-group topics: - name: events destination_id: project.dataset.events authentication: type: basic params: username: env://KAFKA_USERNAME password: env://KAFKA_PASSWORDbizon run config.yml --runner streamConsiderations:
- Requires a stream-capable source, such as Kafka
- Pass
--runner stream:bizon runignoresengine.runner.typein the YAML - Backend must be persistent (postgres, bigquery) for production
- For Kafka to
bigquery_streaming_v2, bizon-rs is a native worker for the same pipelines
Choosing the Right Mode
Section titled “Choosing the Right Mode”┌─────────────────────────────────────────────────────────────┐│ Is your data real-time? ││ (Kafka, message queue) │└─────────────────────────────┬───────────────────────────────┘ │ ┌───────────────┴───────────────┐ │ │ Yes No │ │ ▼ ▼ ┌────────┐ ┌───────────────────────────────┐ │ STREAM │ │ Does source support │ └────────┘ │ incremental queries? │ └───────────────┬───────────────┘ │ ┌───────────────┴───────────────┐ │ │ Yes No │ │ ▼ ▼ ┌─────────────────┐ ┌──────────────────┐ │ Is dataset │ │ FULL_REFRESH │ │ large (>1M)? │ └──────────────────┘ └────────┬────────┘ │ ┌───────────────┴───────────────┐ │ │ Yes No │ │ ▼ ▼ ┌─────────────┐ ┌──────────────────┐ │ INCREMENTAL │ │ FULL_REFRESH │ └─────────────┘ └──────────────────┘Stream Reset
Section titled “Stream Reset”A stream reset is a single run that re-fetches an incremental stream in full and replaces the destination table. Incremental runs resume from the reset run afterwards. Use it when:
- Schema changes require re-syncing all data
- Source data was corrected or backfilled
- The destination table drifted and needs rebuilding
There are two ways to ask for one:
bizon run config.yml --reset # one-shot, this runbizon stream reset config.yml # queued, consumed by the next runbizon stream reset config.yml --cancel # withdraw a queued resetbizon stream reset config.yml --stream deals # pick the stream, for templated configsbizon stream reset stores the request in the backend without running anything, so a pipeline whose command line is fixed by a scheduler picks it up with no change to its cron or Airflow job.
How it works:
- The request is scoped to one stream, keyed on the pipeline
id(orname), source and stream. Other streams of the same pipeline are unaffected. - The run calls
get()instead ofget_records_after(), ignoring the watermark. - Destinations see the run as
full_refreshand replace their table through their full-refresh path (forbigquery: staging into{table}_temp, then aWRITE_TRUNCATEcopy). - The job itself stays
incremental, so the reset run becomes the next run’slast_run. It starts from an emptystate. - A reset that crashes is retried as a reset by the next run, not as an incremental append.
Limits:
- Only
sync_mode: incrementalstreams can be reset.bizon stream resetrefuses other modes; for--resetthe request is ignored with a warning. bigquery_streamingappends even on a full refresh, so a reset there is rejected at config validation.
Ignoring an In-Flight Job
Section titled “Ignoring an In-Flight Job”force_ignore_checkpoint: true cancels a job left running by an interrupted run and starts a new job from iteration 0, instead of resuming from its cursors:
source: name: hubspot stream: contacts sync_mode: incremental force_ignore_checkpoint: trueIt does not reset the incremental watermark: last_run and state still come from the last successful job. To re-fetch everything, use a stream reset. Remove the flag after the run, otherwise every run discards the job it would have resumed.
Next Steps
Section titled “Next Steps”- Sources Overview - Learn about source connectors
- Checkpointing - Understand fault tolerance
- Engine Configuration - Configure backends for checkpoint storage