Skip to content

Checkpointing

Checkpointing is at the heart of Bizon’s reliability. It enables pipelines to recover from failures without reprocessing all data from the beginning.

Bizon tracks progress per iteration (one page or batch returned by the source):

  1. During extraction: The producer records the source’s position (pagination cursor) in the backend
  2. After loading: Once a buffer flush lands in the destination, a destination cursor is saved for the iterations it contained
  3. On failure: The next run resumes from the last destination cursor, so only data that never landed is fetched again
┌─────────────┐
│ Source │
│ │──────▶ Cursor position saved
└─────────────┘
│
▼
┌─────────────┐
│ Backend │◀────── Checkpoint persisted
│ │
└─────────────┘
│
▼
On restart:
Resume from last checkpoint

Delivery is at-least-once: an iteration that was written but not yet checkpointed is written again after a crash.

When an incremental pipeline fails (network issues, destination downtime, etc.), Bizon doesn’t need to re-extract everything. It picks up where it left off.

For pipelines processing billions of records, checkpointing ensures:

  • Consistent progress tracking
  • Reduced manual intervention
  • Faster recovery times

With checkpoints, you always know:

  • What data has been successfully loaded
  • Where the pipeline stopped
  • What needs to be reprocessed (if anything)
Sync modeAfter a crash
incrementalThe job left running is resumed from its last destination cursor
full_refreshThe stale job is cancelled and a new one starts from scratch. Its staging table is cleared, so a partial run is never published
streamThe source’s own offsets (e.g. Kafka consumer offsets) are committed after each successful write

A full refresh restarts rather than resumes because it replaces the whole table on publish. To rebuild an incremental stream from scratch, use a stream reset instead of deleting backend rows: see Sync Modes.

An iteration larger than the destination’s buffer_size is written in buffer-sized chunks. It still gets a single destination cursor, written once every chunk has landed. A crash midway resumes from the previous iteration and rewrites all its chunks.

Checkpointing is automatic. syncCursorInDBEvery sets how often, in iterations, the producer writes its source cursor to the backend:

engine:
backend:
type: postgres
config:
host: db.example.com
port: 5432
database: bizon
schema: public
username: bizon
password: ${env://DB_PASSWORD}
syncCursorInDBEvery: 10
FieldDefaultDescription
syncCursorInDBEvery10Iterations between source cursor writes. Goes inside config
BackendtypeBest ForPersistence
SQLitesqliteLocal developmentFile on disk
SQLite (in-memory)sqlite_in_memoryTestsNone, lost when the process exits
PostgreSQLpostgresProduction, frequent updatesDatabase
BigQuerybigqueryProduction, lightweight setupDataset