Constraint-Driven Data Engineering: Architecting a Modern Data Platform on a Single €6 VM
Why you don't need a cloud budget to do rigorous data engineering. A deep dive into Headless Dagster, Local Delta Lake, and the art of constraint.
Modern data engineering defaults to over-provisioning. For internal platforms, R&D workloads, or early-stage products under 1 TB of data, adopting an enterprise cloud stack (Databricks, Snowflake, or managed Airflow) introduces significant fixed cost and operational overhead before a single byte is processed:
- Orchestration: Managed Airflow or Dagster Cloud
- Compute: Distributed Spark clusters or cloud data warehouses
- Storage: Remote object storage with per-request API latency
- Metadata Database: Managed RDS/CloudSQL instances running 24/7
Constraint-Driven Engineering starts from the opposite premise: how much analytical throughput and operational rigor can we extract from a single, well-architected unit of compute?
This post documents the foundational storage and orchestration layer we built for QuantLens (now evolved into our Portfolio Analytics Platform), running entirely on a single €6/month Hetzner Cloud VM. Rather than cutting architectural corners, we stripped out idle daemon processes and network hops—co-locating Delta Lake storage and vectorized DuckDB/Polars compute on local NVMe.
Single-Node Co-Location vs. Distributed Tax
When a dataset fits under 1 TB, distributing storage, orchestration, and compute across separate cloud services turns local memory lookups into network RPCs.
Consolidating the stack onto localhost eliminates serialization overhead across every layer:
| Component | Cloud Standard | Constraint-Driven Stack |
|---|---|---|
| Hardware | Multi-node K8s / Cloud VMs | Hetzner CAX21 (4 ARM64 vCPU, 8GB RAM, NVMe) |
| Orchestrator | Persistent Webserver + Daemon | Headless Dagster (Library + systemd / Cron) |
| Storage | S3 / GCS (HTTP Latency) | Local NVMe (Direct Block I/O) |
| Table Format | Parquet / Delta Lake | Delta Lake (delta-rs ACID Transactions) |
| Compute | Distributed Spark Cluster | DuckDB + Polars (In-process vectorized) |
The platform idles at 0% CPU and <150MB RAM, then bursts to process tens of millions of financial time-series rows in seconds when a pipeline triggers.
1. Headless Dagster: Orchestration Without Resident Daemons
In a self-hosted data stack, the orchestrator itself is often the largest memory consumer. A standard Dagster deployment requires three persistent services:
dagster-webserver(UI) — ~300MB RAMdagster-daemon(Scheduler/Sensors) — ~200MB RAM- Persistent PostgreSQL instance for run coordination
On an 8GB machine, dedicating over 500MB of RAM continuously just to wait for a scheduled job wastes capacity that belongs to analytical compute.
Treating Dagster as an Ephemeral Execution Library
We stripped Dagster down to its core execution graph: a Python library for defining software-defined assets, type checks, and lineage. Instead of running dagster-daemon, we delegated scheduling to the Linux kernel via systemd timers and cron.
To allow the web dashboard to trigger ad-hoc pipeline runs, we deployed an 80MB Python listener bound to an internal port guarded by UFW:
# infra/ansible/templates/pipeline-trigger-service.py.j2
@app.route('/trigger', methods=['POST'])
def trigger_pipeline():
# Spawns an ephemeral Dagster job subprocess.
# Zero resident daemon memory when pipelines are idle.
cmd = ["dagster", "job", "execute", "-m", "data_pipelines"]
subprocess.Popen(cmd)
return jsonify({"status": "started"})This preserves Dagster's asset lineage, retry policies, and partitioning while reclaiming 500MB of RAM. When inspecting asset graphs during development, we run dagster-webserver locally on a workstation over an SSH tunnel to the production SQLite/Postgres state store.
2. Local NVMe Lakehouse (delta-rs)
Cloud object stores like S3 are designed for multi-tenant durability, not low-latency small-table scans. Every metadata check and Parquet footer read incurs an HTTP roundtrip.
By mounting our Delta Lake tables directly on the host's local NVMe drive via delta-rs (Rust-backed Delta bindings without JVM/Spark dependencies), we get ACID transactions, schema evolution, and time-travel snapshots at local disk I/O speeds:
# data-pipelines/assets/silver.py
@asset
def silver_cleaned_prices(bronze_prices_df):
# Writes directly to local NVMe with Delta transaction log guarantees
table_path = "/data/silver/prices"
write_deltalake(table_path, bronze_prices_df, mode="overwrite")Reliability & Disaster Recovery on a Single Node
Running stateful storage on a single VM requires explicit mitigations for hardware failure:
- Daily Off-Host Snapshots (
RPO = 24h): Compressed Delta Lake snapshots are synced daily to S3-compatible object storage. - Declarative Host Rebuilds (
RTO < 15m): The entire Linux host—Docker runtime, UFW rules, systemd units, and directory mounts—is defined in Ansible (site.yml). If a VM fails, a fresh instance is provisioned and restored from the latest object storage snapshot in under 15 minutes. - Idempotent Medallion Lineage: Because raw Bronze payloads are immutable, Silver and Gold analytical tables can be deterministically recomputed from Bronze at any time.
- External Health Probes: Uptime checks monitor both the API and daily timer completion timestamps.
Owning the Runtime
Relying exclusively on managed cloud abstractions often hides performance bottlenecks behind opaque billing tiers. Building within an 8GB RAM and single-node constraint forces explicit engineering around:
- Out-of-core memory management and streaming execution in Polars/DuckDB
- Linux process isolation and OOM boundaries
- Atomic filesystem commits via the Delta transaction log
When to Scale Out (The Escape Hatch)
Single-node co-location is a deliberate architectural stage, not dogma. We define explicit thresholds for migrating off a single host:
- Dataset Volume: Active working set exceeds 2 TB (local NVMe capacity ceiling).
- Availability SLA: Workload requires 99.99% high-availability failover rather than a 15-minute RTO.
- Team Concurrency: Multiple data engineers running heavy concurrent backfills against the same compute node.
Because every layer is built on open protocols, scaling out requires no application rewrites:
- Storage Decoupling: Updating
DATA_ROOT=s3://bucket-namemoves the Delta Lake tables to remote object storage while keeping the exact same DuckDB, Polars, and Dagster asset code. - Compute Offloading: Heavy analytical queries can be pointed at a separate read-replica VM or migrated directly into Databricks/Snowflake using the existing Delta tables and
dbttransformations.
— Pedro
Founder & Principal Engineer