Skip to content

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.

ModeCreates New JobResumes FromBest For
full_refreshYes, every runBeginning (never resumes)Small datasets, complete snapshots
incrementalYes, unless resuming an interrupted jobStart of the last successful runLarge datasets, append-only data
streamNo, reuses jobLast committed offsetReal-time data, Kafka/queues

Full refresh mode syncs all data from the source on every run.

source:
name: hubspot
stream: contacts
sync_mode: full_refresh

How it works:

  1. Creates a new StreamJob each run
  2. Extracts all records from the source
  3. Continues until pagination is exhausted
  4. 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 mode only syncs new or updated records since the last successful sync.

source:
name: hubspot
stream: contacts
sync_mode: incremental

How it works:

  1. Finds the last successful StreamJob for this pipeline, source and stream
  2. Creates a new StreamJob, or resumes the one an interrupted run left running
  3. Calls the source’s get_records_after() with a source_state built from that last successful job
  4. Syncs until pagination is exhausted
  5. 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.

get_records_after() receives a SourceIncrementalState:

FieldTypeDescription
last_rundatetimeStart time (created_at) of the last successful job, timezone-aware UTC
statedictThe next_state persisted by the last successful job. {} if none
run_started_atdatetimeStart time of the current job, UTC, stable across resumes
cursor_fieldstringThe 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_at

Considerations:

  • 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 mode enables continuous, real-time data ingestion with offset tracking.

source:
name: kafka
stream: topic
sync_mode: stream

How it works:

  1. Uses a single, persistent RUNNING StreamJob
  2. Tracks offsets/positions in the source system
  3. Commits progress periodically to backend
  4. Runs continuously until stopped
  5. 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_PASSWORD
Terminal window
bizon run config.yml --runner stream

Considerations:

  • Requires a stream-capable source, such as Kafka
  • Pass --runner stream: bizon run ignores engine.runner.type in 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
┌─────────────────────────────────────────────────────────────┐
│ 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 │
└─────────────┘ └──────────────────┘

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:

Terminal window
bizon run config.yml --reset # one-shot, this run
bizon stream reset config.yml # queued, consumed by the next run
bizon stream reset config.yml --cancel # withdraw a queued reset
bizon stream reset config.yml --stream deals # pick the stream, for templated configs

bizon 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 (or name), source and stream. Other streams of the same pipeline are unaffected.
  • The run calls get() instead of get_records_after(), ignoring the watermark.
  • Destinations see the run as full_refresh and replace their table through their full-refresh path (for bigquery: staging into {table}_temp, then a WRITE_TRUNCATE copy).
  • The job itself stays incremental, so the reset run becomes the next run’s last_run. It starts from an empty state.
  • A reset that crashes is retried as a reset by the next run, not as an incremental append.

Limits:

  • Only sync_mode: incremental streams can be reset. bizon stream reset refuses other modes; for --reset the request is ignored with a warning.
  • bigquery_streaming appends even on a full refresh, so a reset there is rejected at config validation.

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: true

It 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.