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.
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
| Component | Responsibility |
|---|---|
| Control plane | Spring Boot service that owns the REST API, spec validation, scheduling, run submission, storage browsing, connections, RBAC, and licensing |
| Execution engine | Apache Spark driver that parses the spec, reads sources, applies builds and transforms, and writes destinations |
| Domain model | Shared entities and repository interfaces (Pipeline, PipelineRun, PipelineSchedule) |
| Persistence layer | JDBC 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
- Submit - a client calls
POST /api/pipelines/{pipelineId}/exec(orsave-and-exec); the app checks the license, validates the spec, and writes aPipelineRunrow asPENDING. - Dispatch - the app submits the job to the Spark Master REST API (
/v1/submissions/create) with the engine jar;execution.settingsoverride the Spark submit defaults. - Execute - the driver verifies the license proof, builds a Spark session, and runs the engine: sources → builds → transforms → destinations.
- 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 withPOST .../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.
| Table | Purpose |
|---|---|
pipelines | Pipeline registry: name, mode, spec URI, latest version, soft delete |
pipeline_runs | One row per execution: status, timing, Spark submission ID, spec snapshot |
pipeline_run_stages | Per-stage tracking: status, output row count, failure reason, lineage sample |
pipeline_schedules | Cron schedules per pipeline, next/last run times |
pipeline_source_offsets | Incremental read offsets per (pipeline, source, asset) |
connections + connection_auths | Saved external connections and their credentials |
users, roles, permissions, user_roles, role_permissions | RBAC (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:
| Mode | Spark containers | Product storage |
|---|---|---|
object | master + 2 workers + history | RustFS (S3-compatible) |
single | one container: master + worker | same as object |
shared | same trio, stock image | shared /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):
| What | Shared mode | Object mode |
|---|---|---|
| Pipeline definitions | pipeline-definitions | pipeline/pipeline-definitions |
| Inputs | inputs | pipeline/inputs |
| Outputs | outputs | pipeline/outputs |
| Stage samples | outputs/samples | pipeline/samples |
| Streaming checkpoints | spark-checkpoints | pipeline/checkpoints |
| Stateful step state | pipeline-state | pipeline/state |
Services and ports
| Service | URL | Modes |
|---|---|---|
| Pipeline API | http://localhost:8080 | all |
| API docs (Swagger) | http://localhost:8080/swagger-ui.html | all |
| Spark Master UI | http://localhost:8085 | all |
| Spark Worker 1 UI | http://localhost:8086 | all |
| Spark Worker 2 UI | http://localhost:8087 | shared, object |
| Spark History Server | http://localhost:18080 | shared, object |
| RustFS API | http://localhost:9000 | object, single |
| RustFS console | http://localhost:9001 | object, single |
| PostgreSQL | localhost:5433 | all |
| App JVM debug port | localhost:5005 | all |
Security
- All
/api/**endpoints require a Bearer JWT from the configured OIDC identity provider (issuer and audience configurable viaOIDC_ISSUER_URI/OIDC_AUDIENCE). The platform is identity-provider agnostic: any OIDC-compliant provider works. - Authorization is permission-based RBAC - 40 permissions like
pipeline:executeandconnection:create- enforced with@PreAuthorizeon 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