Data FlowData Flow
DataFlow
  • User Manual
  • Developer Manual
  • Examples
  • API Reference
Overview
    IntroductionArchitecture OverviewCore Concepts
Getting Started
Pipeline Authoring
Execution
Deployment
Troubleshooting
Examples
Overview

Architecture Overview

Data Pipeline separates a Spring Boot control plane from an Apache Spark data plane. The control plane owns the REST API, spec validation, scheduling, and run submission; the data plane executes each pipeline as a distributed Spark job. All state lives in PostgreSQL, and all product-managed files live in S3-compatible object storage or on a shared volume.

Data Pipeline architecture
ClientsIdentityControl planeData planePersistence

At a glance

  • Two planes, one API - a control plane and a data plane, connected only by REST
  • PostgreSQL is the system of record - pipelines, runs, stages, schedules, offsets, and RBAC
  • Storage is pluggable - S3-compatible object storage (recommended) or a shared volume
  • Access is permission-based - every /api/** call carries a JWT from the configured identity provider and a scoped permission
  • Execution is licensed - checked when a run is submitted and again inside the Spark driver

Components

ComponentResponsibility
Control planeSpring Boot service that owns the REST API, spec validation, scheduling, run submission, storage browsing, connections, RBAC, and licensing
Execution engineApache Spark driver that parses the spec, reads sources, applies builds and transforms, and writes destinations
Domain modelShared entities and repository interfaces (Pipeline, PipelineRun, PipelineSchedule)
Persistence layerJDBC adapters plus the reporter that writes run status back to the database

The control plane never touches the data itself: it validates the spec, submits the run, and then tracks status. Both planes share the same domain model and persistence layer.

Two Spring profiles control how pipelines run. cluster (the default in Docker) submits every run to the Spark Master REST API, with no in-process Spark. local runs Spark in-process (spark.master=local[*]) via POST /api/local/run, which is handy for quick engine experiments from an IDE.

How a run executes

  1. Submit - a client calls POST /api/pipelines/{pipelineId}/exec (or save-and-exec); the app checks the license, validates the spec, and writes a PipelineRun row as PENDING.
  2. Dispatch - the app submits the job to the Spark Master REST API (/v1/submissions/create) with the engine jar; execution.settings override the Spark submit defaults.
  3. Execute - the driver verifies the license proof, builds a Spark session, and runs the engine: sources → builds → transforms → destinations.
  4. Reconcile - the driver writes status, stages, and offsets straight to PostgreSQL; the app polls Spark every 30 seconds (pipeline.run-status-checker.interval-ms) and can kill a run with POST .../runs/{runId}/kill.

See Execution Lifecycle for statuses, retries, and stage-level detail.

Persistence (PostgreSQL)

PostgreSQL 15 runs as its own container (host port 5433, database bl-pipeline). The schema is created and migrated by Liquibase at startup.

TablePurpose
pipelinesPipeline registry: name, mode, spec URI, latest version, soft delete
pipeline_runsOne row per execution: status, timing, Spark submission ID, spec snapshot
pipeline_run_stagesPer-stage tracking: status, output row count, failure reason, lineage sample
pipeline_schedulesCron schedules per pipeline, next/last run times
pipeline_source_offsetsIncremental read offsets per (pipeline, source, asset)
connections + connection_authsSaved external connections and their credentials
users, roles, permissions, user_roles, role_permissionsRBAC (seeded roles: SUPER_ADMIN, ADMIN, DEVELOPER)

Storage backends

Everything the product manages - pipeline definitions, inputs, outputs, samples, checkpoints, and state - lives in one of two backends, selected with APP_STORAGE_BACKEND:

ModeSpark containersProduct storage
objectmaster + 2 workers + historyRustFS (S3-compatible)
singleone container: master + workersame as object
sharedsame trio, stock imageshared /app/data volume

object is the recommended backend; the code default is shared, the legacy local-volume mode. In object and shared modes the master and workers run as separate containers; single mode collapses them into one container that keeps the hostname spark-master, so the app configuration stays identical.

In object and single modes Spark reads product-managed files via s3a://, and driver logs are archived to object storage (APP_DRIVER_LOG_ARCHIVE_ENABLED=true). In shared mode everything lives on the shared /app/data volume.

Storage layout - in shared mode these live under /app/data; in object mode under the bucket's base prefix (default pipeline):

WhatShared modeObject mode
Pipeline definitionspipeline-definitionspipeline/pipeline-definitions
Inputsinputspipeline/inputs
Outputsoutputspipeline/outputs
Stage samplesoutputs/samplespipeline/samples
Streaming checkpointsspark-checkpointspipeline/checkpoints
Stateful step statepipeline-statepipeline/state

Services and ports

ServiceURLModes
Pipeline APIhttp://localhost:8080all
API docs (Swagger)http://localhost:8080/swagger-ui.htmlall
Spark Master UIhttp://localhost:8085all
Spark Worker 1 UIhttp://localhost:8086all
Spark Worker 2 UIhttp://localhost:8087shared, object
Spark History Serverhttp://localhost:18080shared, object
RustFS APIhttp://localhost:9000object, single
RustFS consolehttp://localhost:9001object, single
PostgreSQLlocalhost:5433all
App JVM debug portlocalhost:5005all

Security

  • All /api/** endpoints require a Bearer JWT from the configured OIDC identity provider (issuer and audience configurable via OIDC_ISSUER_URI / OIDC_AUDIENCE). The platform is identity-provider agnostic: any OIDC-compliant provider works.
  • Authorization is permission-based RBAC - 40 permissions like pipeline:execute and connection:create - enforced with @PreAuthorize on each endpoint. Seeded roles: SUPER_ADMIN, ADMIN, DEVELOPER; custom roles can be created at runtime.
  • New users are either invited (INVITE_ONLY, the default) or auto-provisioned on first login (AUTO_PROVISION).
  • Public endpoints: /actuator/**, /v3/api-docs/**, /swagger-ui/**, and tokenized file downloads.

Licensing

Execution is gated by a Keygen-based license: validated when a run is submitted, and verified again inside the Spark driver (LicenseProofEnforcer). Configure with DATAFLOW_LICENSE_MODE (online/offline), DATAFLOW_LICENSE_KEY, or DATAFLOW_LICENSE_FILE. Check status any time via GET /api/license/status.

AI agents

The platform also ships an AI agent stack that drives the same REST API: an agent runtime with chat, sessions, and approvals; typed MCP tools for every pipeline operation; and skills that teach agents the pipeline model. DataFlow stays the authority: the agent works with the same JWT and the same permissions, and every mutation (Apply, Run, schedule changes) pauses for an explicit human approval.

Related pages

  • Core Concepts - the spec model, sources, transforms, destinations
  • Installation - bringing the stack up
  • Quick Start - your first pipeline run
  • AI Agents - the agent stack
  • API Reference - the full REST surface
Suggest edit
Last modified on November 26, 2026
IntroductionCore Concepts
On this page
  • At a glance
  • Components
  • How a run executes
  • Persistence (PostgreSQL)
  • Storage backends
  • Services and ports
  • Security
  • Licensing
  • AI agents
  • Related pages