Start at crates/daemon/src/main.rs for the CLI,
then runtime.rs for startup, recovery and
the scheduling loop. The workspace libraries are implementation components;
their package names share the flow- prefix and expose their public API through
lib.rs.
| Directory | Responsibility |
|---|---|
model |
Storage-independent identities, schemas, rows and source transactions. |
ingress-journal |
Durable transaction frames, segmented storage and bounded replay. |
pg-source |
PostgreSQL snapshot, replication protocol and transaction assembly. |
state-store |
Durable control records, replaceable row index and atomic delta application. |
durability |
Optional object-storage authority: ordered write-behind log, checkpoints, owner leases and restore. |
iceberg-ext |
Iceberg commit actions, manifests and artifact tracking used by Flow. |
materializer |
Schema conversion and bounded Parquet data/delete writers. |
catalog-watch |
Classification and row-identity checks for external snapshot changes. Catalog polling belongs to the caller. |
compactor |
Rewrite planning, bounded workers and late-delete translation. |
coordinator |
Publication, maintenance, external reconciliation and source acknowledgement. |
daemon |
Configuration, process lifecycle and scheduling the table/source work. |
testkit |
Shared local fixtures and integration tests spanning the libraries. |
Source capture writes complete transactions to the journal. The coordinator collapses them, asks materializers or compactors to build artifacts, publishes through Iceberg, and applies the resulting index changes before completing the source ledger. Workers build artifacts; the coordinator owns publication. See Architecture for the durable transition rules.
- The daemon's
runtime/pending.rsowns transaction admission,runtime/table.rsexecutes table work, andruntime/health.rshandles source health. The parent module owns task scheduling and completion. - The coordinator's
publication/collapse.rsprepares an epoch from journal input;publication.rspublishes and recovers it.artifacts.rstracks object ownership shared by publication and maintenance. Themaintenance/modules cover background builds, delete rewrites, manifests, garbage and recovery. - In the state store,
control.rsowns durable control state,reader.rsowns read views,spool.rsandbuffer.rscollapse mutations, andapply.rsapplies committed row-location changes. The root retains store setup and durable transition sequencing. - The journal's
frame.rsdefines its disk format. The root owns writing, syncing and recovery;chunks.rsandtransactions.rsprovide replay readers. - Remote durability attaches through two narrow hooks, the journal's
Mirrorand the control store'sControlMirror. Incrates/durability,writer.rsowns the ordered queue, batching and lease,checkpoint.rscheckpoints and retention,recovery.rsownership and restore, andformat.rsthe object layout. The daemon'sdurability.rsplaces barriers before external effects.
Keep modules named for the responsibility they own. Use private modules and narrow visibility for implementation details; moving a function does not make it a new public API. Add a crate when it establishes a useful dependency or ownership boundary, rather than to shorten a file.
Crate-local tests/ directories exercise that library's public API. Cross-crate
integration tests live in crates/testkit/tests/; private implementation tests
stay beside their owner. The local smoke suite and
service suites use PostgreSQL, object storage and
independent readers. Performance fixtures share that service setup.
examples/flow.toml is the configuration example;
demo/ is the packaged deployment example. scripts/
contains distribution tooling. vendor/ contains pinned
upstream code and its modification records. Current benchmark results and
reproduction instructions are in Performance.
Use the commands in Contributing to build and test. For
cross-linked library documentation, run cargo doc --locked --workspace --no-deps
and open target/doc/flow_coordinator/index.html.