Skip to main content

Pipelines

A pipeline is the core unit of work in Laredo. Each pipeline binds one source table to one target, with optional filters and transforms in between.

Pipeline structure

Pipeline {
id: "pg_main:public.config_document:indexed-memory"
source: SyncSource (shared across pipelines)
table: TableIdentifier
filters: []PipelineFilter
transforms: []PipelineTransform
target: SyncTarget
buffer: ChangeBuffer (bounded, per-pipeline)
errorPolicy: ErrorPolicy
ttlPolicy: TtlPolicy (optional)
}

Source sharing

Sources are instantiated once and shared. If a PostgreSQL source feeds three tables into different targets, that is one source instance, one replication stream, and three target instances. The engine demuxes changes from the source by table and dispatches to the correct pipelines.

Fan-out

A single table can fan out to multiple targets. When this happens, the engine delivers each change to all targets for that table. Source ACK advances only after all targets for that source have confirmed IsDurable().

PostgreSQL (1 slot)

▼ stream demux by table

├──► Pipeline: config_document → indexed-memory
├──► Pipeline: config_document → http-sync
└──► Pipeline: config_document → replication-fanout

Pipeline states

Each pipeline has an independent lifecycle:

StateMeaning
INITIALIZINGPreparing to start
BASELININGLoading initial snapshot from source
STREAMINGReceiving and applying live changes
PAUSEDPaused by operator request
ERRORUnrecoverable error (isolated from others)
STOPPEDShut down

Buffer policies

Each pipeline has a bounded change buffer between the source dispatcher and the target:

PolicyBehavior
blockBackpressure to source (safe default)
drop_oldestRing buffer — drop oldest undelivered change
errorMark pipeline as ERROR when full

Error policies

When a pipeline fails persistently:

PolicyBehavior
isolateMark pipeline ERROR, continue all others
stop_sourceStop all pipelines on this source
stop_allHalt the entire engine

Failed changes can optionally be written to a dead letter store for later inspection and replay.