Stream pipelines
Conceptual overview of Nilus stream pipelines: connecting to Kafka or NATS+JetStream, consuming records in micro-batches, and writing them to a destination.
Not every source exposes changes through a database log. Event systems such as Kafka and NATS+JetStream publish a continuous sequence of records that must be consumed as they arrive. That is where stream pipelines fit. Nilus connects to the broker, consumes records in micro-batches, and writes each batch to the selected destination.
Stream pipeline model
Nilus models stream ingestion as type: nilus with spec.type: stream. The manifest declares a source topic or stream, a sink, and consumer settings. Nilus handles the runtime service, offset tracking, and destination loading. Stream suits continuously published events where the destination needs low lag.
For manifest fields and connector options, see Stream pipeline config. For ready-to-use Kafka and NATS+JetStream manifests, see Stream sample configs.
Core capabilities
Stream type is built around the following capabilities:
Continuous consumption
Stream pipelines stay connected after startup and pull new records indefinitely when
run_in_loop: trueis set.Nilus tracks consumer positions (Kafka consumer-group offsets, NATS JetStream sequence numbers) so a restart resumes from the last committed position without reprocessing old records.
Consumer identity (
group_idfor Kafka,durable=for NATS) must stay stable across deployments for offset continuity to hold.
Micro-batch model
Records are pulled from the source in configurable batches before being written to the sink.
batch_sizeand batch timeout control how many records are accumulated per write and how long Nilus waits to fill a batch on a quiet topic.This model balances throughput against write latency and makes it straightforward to tune for different traffic profiles.
Flexible destination writes
Stream sinks follow the same destination model as batch and CDC pipelines.
incremental_strategy: appendis the default for event-shaped data.mergeis supported when the destination has a stable primary key and deduplication is required.
Flow
Nilus connects to the source broker or cluster using the configured URI and projected credentials.
A consumer pulls a micro-batch of records from the topic or stream.
Nilus applies any configured masking or shaping to the batch.
The sink writes the batch to the destination and Nilus commits the consumer offset.
Steps 2–4 repeat continuously while
run_in_loop: trueis set.
Constraints
Stream pipelines are long-running services, not cron jobs. Do not add a
spec.scheduleblock.run_in_loop: truemust be set explicitly undersource.options; without it, Nilus exits after the first pull.Source offset retention governs how far back a restarted pipeline can resume. If the consumer falls behind beyond the retention window, a re-snapshot may be required.
Destination behavior still depends on the chosen sink; the destination page is the source of truth for target-specific options.
Related docs
Last updated
Was this helpful?