Architecture
ArkFlow is a stream processing engine: it reads data from sources, transforms it through a chain of processors, and writes it to sinks — all defined in a single YAML configuration file. This page describes the runtime concepts that the rest of the documentation builds on.
Engine
The engine is the top-level process. It loads a configuration and runs one or more streams concurrently, plus an HTTP health-check / control-plane server. Each stream is independent; they share only the process and its component registry (inputs, outputs, processors, buffers, codecs).
Stream
A stream is the unit of data processing. It wires together:
- Input — reads raw messages from a source (Kafka, MQTT, HTTP, file, …).
- Buffer — optional windowing between the input and the processors. In
compiled Streams the plain
memorybuffer is a no-op pass-through (bounded channels already provide buffering),tumbling_window/session_windowcompile to a processing-time window operator, and the legacysliding_windowandjoinbuffers are rejected by the stream compiler with a migration error. - Pipeline — an ordered list of processors applied to each batch, run by
thread_numworker tasks in parallel. - Output — writes each processed batch to a sink. An optional
error_outputreceives batches a processor failed on (as raw batches, or wrapped in the dead-letter envelope under anon_errorpolicy). - Durability — an optional per-stream write-ahead log (WAL) that persists messages at the input boundary so they survive crashes (see Delivery semantics).
Message model
Data flows through a stream as a MessageBatch — a thin wrapper around an
Apache Arrow RecordBatch. Columnar Arrow gives
the engine high throughput and lets SQL processors run directly on the data
without reserializing. Inputs may also attach standardized metadata columns
(see Metadata).
Concurrency model
Each stream runs as a set of cooperative async tasks on the Tokio multi-threaded runtime:
- one input worker reading from the source,
- several processor workers (configurable via
pipeline.thread_num), - one output worker writing to the sink with ordered delivery.
They communicate through bounded flume channels (capacity 1024) and shut
down together via a CancellationToken. Compiled streams run through the
unified execution kernel, which joins its processor and collector workers on
shutdown (a TaskTracker additionally tracks the fan-in reader tasks of
multiple_inputs).
Continue to Backpressure & ordered delivery.