Engine Configuration
The engine configuration controls how Bizon stores state, passes messages between pipeline stages, and executes workloads. Everything on this page lives under the top-level engine: key.
Overview
Section titled “Overview”engine: backend: type: postgres config: host: localhost port: 5432 database: bizon schema: public username: bizon password: env://POSTGRES_PASSWORD
queue: type: python_queue config: max_nb_messages: 1000000
runner: type: thread config: max_workers: 2 log_level: INFOEvery section is optional. Without engine:, Bizon uses a local SQLite backend, an unbounded python_queue and the thread runner.
Backends
Section titled “Backends”Backends store pipeline state: jobs, cursors for recovery, incremental state and pending stream resets.
Backend Types
Section titled “Backend Types”| Type | Use Case | Persistence |
|---|---|---|
sqlite | Development | File <database>.sqlite3 in the working directory |
sqlite_in_memory | Testing | None |
postgres | Production | Full |
bigquery | Serverless production | Full |
Backend Configuration
Section titled “Backend Configuration”Every backend has a type and a config block. These keys go inside config:
| Field | Type | Default | Description |
|---|---|---|---|
database | string | Required | Database name. For BigQuery, the GCP project |
schema | string | Required | Schema name. For BigQuery, the dataset |
syncCursorInDBEvery | int | 10 | Write the cursor to the backend every N iterations |
echoEngine | bool | false | Log the SQL issued by SQLAlchemy |
SQLite (Development)
Section titled “SQLite (Development)”Stores state in bizon.sqlite3 in the working directory. schema is required but not used.
engine: backend: type: sqlite config: database: bizon schema: publicSQLite In-Memory (Testing)
Section titled “SQLite In-Memory (Testing)”No persistence, useful for unit tests:
engine: backend: type: sqlite_in_memory config: database: bizon schema: publicPostgreSQL (Production)
Section titled “PostgreSQL (Production)”engine: backend: type: postgres config: host: localhost port: 5432 database: bizon schema: public username: bizon_user password: gsm://bizon-postgres-password| Field | Type | Description |
|---|---|---|
host | string | Database host |
port | int | Database port |
username | string | Database user |
password | string | Database password. Use a secret reference |
The state tables are created in the connection’s search_path. Install the postgres extra: pip install 'bizon[postgres]'.
BigQuery (Serverless)
Section titled “BigQuery (Serverless)”Stores state in BigQuery tables:
engine: backend: type: bigquery config: database: my-project schema: bizon_state create_schema: true schema_location: EU| Field | Type | Default | Description |
|---|---|---|---|
database | string | Required | GCP project |
schema | string | Required | Dataset holding the state tables |
create_schema | bool | false | Create the dataset if it doesn’t exist. When false, a missing dataset fails the run with an error naming this flag |
schema_location | string | None | Location of the dataset when it is created (US, EU, europe-west1, …), and of the backend’s query jobs. Unset keeps BigQuery’s default |
service_account_key | string | "" | Ignored, with a warning. The backend authenticates with Application Default Credentials |
BigQuery cannot move a dataset after it is created, so set schema_location before the first run.
The backend often shares its dataset with a BigQuery destination. When database and schema match the destination’s project_id and dataset_id:
create_dataset: trueon the destination requirescreate_schema: trueon the backend, because the backend checks the dataset before the destination runs. The config is rejected otherwise.- With
create_schema: trueand noschema_location, the backend uses the destination’sdataset_location. Ifschema_locationis set and differs, Bizon warns.
Queues
Section titled “Queues”Queues pass iterations from the producer (source) to the consumer (destination) in the thread and process runners. The stream runner doesn’t use a queue.
Queue Types
Section titled “Queue Types”| Type | Status |
|---|---|
python_queue | Supported. In-memory, no external dependencies |
kafka | Unmaintained |
rabbitmq | Unmaintained |
Python Queue
Section titled “Python Queue”engine: queue: type: python_queue config: max_nb_messages: 1000000 max_bytes: 1073741824 queue: max_size: 0 consumer: poll_interval: 1Queue Configuration
Section titled “Queue Configuration”| Field | Type | Default | Description |
|---|---|---|---|
max_nb_messages | int | 1000000 | Pause the producer once the queue holds about this many records, estimated from the average records per iteration |
max_bytes | int | None | Pause the producer once the queued iterations take about this many bytes, estimated from the average size of the iterations produced so far |
queue.max_size | int | 0 | Maximum number of iterations in the queue. 0 is unbounded |
consumer.poll_interval | int | 1 | Seconds between consumer polls |
Set max_bytes to bound memory when record sizes vary a lot; max_nb_messages alone counts records, not bytes.
Runners
Section titled “Runners”Runners control how the pipeline executes: concurrency model and logging.
Runner Types
Section titled “Runner Types”| Type | Concurrency | Use Case |
|---|---|---|
thread | Producer and consumer threads | Default, most workloads |
process | Producer and consumer processes | CPU-heavy transforms |
stream | Single loop, no queue | Continuous streaming |
Thread Runner (Default)
Section titled “Thread Runner (Default)”Runs the producer and consumer in a thread pool, connected by the queue:
engine: runner: type: thread config: max_workers: 2 consumer_start_delay: 2 is_alive_check_interval: 2 log_level: INFOIf either side fails, the runner stops the other and returns a failed status. A producer that returns an error lets the consumer drain without publishing; a producer that raises stops the consumer.
Process Runner
Section titled “Process Runner”Runs the producer and consumer in separate processes:
engine: runner: type: process config: max_workers: 2 log_level: INFObizon run config.yml --runner process- It uses at least 2 workers, whatever
max_workerssays, so the consumer never waits behind a producer blocked on a full queue. - Workers start with
spawnon every platform. - A failing consumer stops the producer, and a producer that raises stops the consumer.
- Workers log at
log_level. - It returns a status like the thread runner, so
--result-jsonworks.
Stream Runner
Section titled “Stream Runner”Reads a batch, applies transforms, writes it straight to the destination and commits the source, in one loop that runs until stopped. There is no queue, and the destination buffer is disabled. Use it with sync_mode: stream sources such as Kafka:
bizon run config.yml --runner streamFor Kafka → bigquery_streaming_v2 stream pipelines, bizon-rs is a native Rust worker that writes byte-identical rows at a fraction of the CPU. It accepts a strict subset of this config: its engine block takes only runner.type and runner.log_level, and rejects engine.backend and engine.queue.
Runner Configuration
Section titled “Runner Configuration”| Field | Type | Default | Description |
|---|---|---|---|
type | enum | thread | thread, process or stream. Overridden by --runner |
config.max_workers | int | 2 | Pool size. The process runner uses at least 2 |
config.consumer_start_delay | int | 2 | Seconds to wait after starting the producer before starting the consumer |
config.is_alive_check_interval | int | 2 | Seconds between liveness checks (thread runner) |
log_level | enum | INFO | TRACE, DEBUG, INFO, WARNING, ERROR or CRITICAL |
Production Configuration
Section titled “Production Configuration”An incremental pipeline whose state lives next to its data in BigQuery:
name: hubspot-contactsid: hubspot-contacts
source: name: hubspot stream: contacts sync_mode: incremental authentication: type: api_key params: token: gsm://hubspot-api-token
destination: name: bigquery config: project_id: my-project dataset_id: raw_hubspot dataset_location: EU create_dataset: true gcs_buffer_bucket: my-project-bizon-buffer
engine: backend: type: bigquery config: database: my-project schema: raw_hubspot create_schema: true syncCursorInDBEvery: 10 queue: type: python_queue config: max_nb_messages: 1000000 max_bytes: 1073741824
secrets: gsm: project_id: my-projectbizon run config.yml --result-json /tmp/bizon-result.jsonThe backend inherits EU from dataset_location when it creates the dataset. id keeps the pipeline’s state if name changes.
Development Configuration
Section titled “Development Configuration”Simple local setup:
name: dev-pipeline
source: name: dummy stream: creatures authentication: type: api_key params: token: dummy_key
destination: name: logger config: {}With no engine: block, Bizon uses a sqlite backend (bizon.sqlite3), an unbounded python_queue and the thread runner.
Next Steps
Section titled “Next Steps”- Configuration Reference - Complete YAML options
- Secrets - Keep credentials out of your config
- Checkpointing - Understand fault tolerance
- Queues - Queue system deep dive