Skip to content

00 · Architecture overview

Status: Accepted · Owner: Platform · Last reviewed: 2026-09-30

Nasterra Flux turns operational data from any source into datasets: versioned, typed, self-contained units you can query, subscribe to, and build on. You build pipelines visually on a canvas. Each run executes in an isolated compute pod, and every step publishes events you can watch live or use to trigger other work.

This document is the map. Each area has its own design document (01–12) and decisions are recorded as ADRs in adr/.

Goals

  1. Visual pipeline building with a live schema and sample at every node.
  2. Any source: every major database engine, HTTP APIs, and file drops.
  3. Datasets on Parquet (DuckLake table format) with low-latency OLTP-style reads served from the same files, and an optional write path.
  4. Fast, truly concurrent execution in Rust, with concurrency configurable per node.
  5. Fail loud: a fault in any run stops that run with a clear error. No silent retries.
  6. Supply-chain safety: connectors run only if their signed digest matches the pin.
  7. Everything configurable is versioned with latest and active flags and rollback.
  8. Event-driven automation: schedules, calendars, and trigger rules.

Non-goals (for now)

  • Multi-region replication, real-time CDC from every engine, a notebook/SQL IDE, and a public multi-tenant SaaS. The model leaves room for all of them (see §9).
flowchart LR
  user([Builder / operator]) -->|browser| edge[flux.nasterra.com]
  app([Apps & services]) -->|REST / Flight SQL| edge
  edge --> flux[Nasterra Flux]
  flux -->|extract| src[(Databases · HTTP APIs · file drops)]
  flux -->|deliver| tgt[(Datasets · databases · files · webhooks)]
  flux -->|email| mail[Nasterra mail service]
  ci[GitLab CI · devops.nabil.ie] -->|images, signed connectors| flux
Component Language Kind Responsibility
flux-site Astro static Marketing site /, documentation /docs
flux-web React static SPA Canvas, catalog, runs, Forge UI at /app
flux-api Python (FastAPI) service Control plane: config & versioning, connections & vault, pipelines, orchestration, scheduler, trigger rules, notifications, auth, audit, WebSocket gateway (/api, /ws)
flux-runner Rust k8s Job Executes one pipeline run (or one shard of it) and exits
connectors Rust (+ ADBC drivers) subprocess Talk to one source/target family; streamed from the runner over Arrow IPC
flux-preview Rust service Test connections, discover schemas, collect samples, run a draft pipeline on samples
flux-dataset Rust service OLTP-style reads (get / range / query / sample / schema), subscriptions, optional writes
flux-forge Rust service Signed artifact registry for connector binaries (internal only)
enki Postgres — shared Control-plane metadata and the DuckLake catalog (schema ducklake)
objects (Versity S3 Gateway, ADR-0006) — stateful Parquet data files, samples, Forge artifacts
NATS JetStream — stateful Event bus: status, progress, completion, triggers, subscriptions

The split is deliberate: Python decides, Rust does. The control plane owns state and intent; everything that touches data volume is Rust (ADR-0001).

flowchart TB
  subgraph edge[Ingress · flux.nasterra.com]
    r1["/  /docs"] --> site[flux-site]
    r2["/app"] --> web[flux-web]
    r3["/api  /ws"] --> api[flux-api]
  end
  api <--> pg[(enki Postgres<br/>metadata + DuckLake catalog)]
  api -- create Job --> runner[flux-runner]
  api <--> nats[(NATS JetStream)]
  api --> preview[flux-preview]
  api --> dataset[flux-dataset]
  runner -- fetch + verify --> forge[flux-forge]
  preview -- fetch + verify --> forge
  runner -- spawn · Arrow IPC --> conn[connector process]
  preview -- spawn · Arrow IPC --> conn
  conn --> ext[(external systems)]
  runner --> s3[(Object storage<br/>Parquet)]
  runner --> pg
  dataset --> s3
  dataset --> pg
  forge --> s3
  runner & preview & dataset & forge -- events --> nats
Concept Meaning
Connection Versioned, encrypted credentials + settings for one external system
Pipeline Versioned graph of nodes: sources/extractors → processing → targets
Node One step. Declares inputs, outputs, config, and optional concurrency
Dataset A DuckLake table: Parquet files + catalog rows. Has schema, description, sample, key, and a serving profile
Run One execution of one pipeline version, with a compute profile and shard count
Event A message on NATS describing something that happened (run progress, commit, …)
Trigger rule Condition over events/time that starts a pipeline’s active version
Schedule / calendar Time-based triggers, including business-calendar rules
Artifact A signed connector binary or bundle in Forge
Config item Anything versioned: pipelines, connections, schedules, rules, calendars, profiles, connector pins
sequenceDiagram
  participant U as Canvas
  participant A as flux-api
  participant P as flux-preview
  participant C as connector
  U->>A: test connection / collect sample
  A->>P: request (connection resolved + decrypted server-side)
  P->>P: fetch connector from Forge, verify signature + pin
  P->>C: spawn, handshake, sample(n)
  C-->>P: Arrow record batches
  P-->>A: sample id + schema
  U->>A: preview draft pipeline
  A->>P: spec + sample ids
  P-->>U: per-node schema, rows, stats, errors

Samples are stored once (object storage, keyed by connection version) and reused by every node downstream, so the whole canvas shows real data without hitting the source repeatedly.

  1. A trigger (manual, schedule, rule, API) asks the orchestrator to run pipeline P, version = active.
  2. flux-api checks quotas, records a run row (queued), and creates a k8s Job (an Indexed Job when sharded) with the compute profile’s CPU/memory.
  3. Each runner pod loads the spec, fetches and verifies connectors, spawns them, builds a DataFusion plan, streams data through it, and writes Parquet to a staging area.
  4. Runners publish flux.run.<id>.* events (status, per-node progress, logs).
  5. When every shard succeeds, the orchestrator commits all staged files for each target dataset in one DuckLake transaction tagged with the run id (idempotent). Any failure → no commit, run failed, event + notification.
  6. flux.dataset.<name>.committed fires. flux-dataset invalidates caches; subscribers and trigger rules react.

Apps call flux-dataset for point lookups, key ranges, filtered queries, or samples. Reads use sorted Parquet with bloom filters and page indexes, cached footers, and an LRU page cache to reach single-page reads for point lookups. Writes (optional, per dataset) go to a WAL + memtable and are merged on read, then flushed as DuckLake commits. See 07.

State Where Notes
Config items + versions Postgres flux DB Generic versioning (10)
Connection secrets Postgres, AES-256-GCM encrypted Key from flux-config secret; never sent to the browser
Runs, events index, audit Postgres Runs are immutable after completion
DuckLake catalog Postgres schema ducklake Snapshots, file lists, stats
Parquet data Object storage flux-data Immutable files; new commit = new files
Samples Preview sample cache (memory) Short retention
Artifacts Object storage flux-forge + Postgres metadata Content-addressed by sha256
Events NATS JetStream Retention per stream (08)
Dataset WAL PVC on flux-dataset Only for write-enabled datasets
  • Fail loud. Runner exits non-zero on any fault, Jobs use backoffLimit: 0, the failure is an event and a notification. Retries are explicit policy, never implicit.
  • Isolation per run. One Job per run; connectors are separate processes; scratch is per run. Warm reuse, if enabled later, re-verifies artifacts and wipes state.
  • Idempotent commits. A run commits at most once; retries of the commit step are safe.
  • Everything versioned. Pipelines, connections, schedules, rules, calendars, compute profiles, connector pins.
  • Secrets stay server-side. Decrypted only inside flux-api/preview/runner memory.
  • Contracts shared across languages. The pipeline spec has one JSON Schema used by Python and Rust (01).
  • Docs ship with code. Every change updates its design doc and user doc.

One public host, flux.nasterra.com, on the Nasterra k3s cluster (namespace flux): / and /docs → flux-site, /app → flux-web, /api and /ws → flux-api. flux-forge, flux-preview, flux-dataset, object storage and NATS are ClusterIP only. flux-dataset gets a separate authenticated route only when external apps need it. Images build in GitLab (nasterra/flux, branch master) with Kaniko and deploy with the ci-deployer service account. See 12.

  • AWS: object storage → S3, enki → RDS, runner Jobs → EKS or ECS tasks. Only endpoints change.
  • Scale-out serving: more flux-dataset replicas (reads are stateless per dataset; writers are single-owner per dataset via leases).
  • CDC / streaming sources: the connector protocol already streams; long-running “streaming runs” become a run mode.
  • Multi-tenant: tenant id on every config item, run, dataset, and event subject.
# Document
01 Pipeline spec
02 Execution engine
03 Concurrency
04 Connectors & protocol
05 Forge & supply-chain security
06 Dataset storage
07 Dataset serving & OLTP
08 Events & WebSocket
09 Scheduling, calendars & triggers
10 Versioned configuration
11 Security & auth
12 Deployment & operations