QuantLens: Low-Cost High-Performance Data Platform
Foundational local NVMe Delta Lake and DuckDB storage architecture — now evolved into the JPR Labs Portfolio Analytics Platform.
Evolution Note: QuantLens served as our foundational storage and orchestration prototype (local NVMe Delta Lake + DuckDB + Headless Dagster). Its architecture has since been consolidated into the full Portfolio Analytics Platform, which adds stateless multi-factor equity scoring, point-in-time SEC filing lag enforcement, and asymmetric LLM downside governance.
Overview
QuantLens is a financial data lakehouse built to demonstrate that analytical workloads under 1 TB/day do not require distributed cloud warehouses like Databricks or Snowflake. We architected a complete Bronze/Silver/Gold medallion platform that runs on a single self-hosted server costing €6/month.
Architectural Thesis: Single-Node Density vs. Distributed Overhead
Enterprise data platforms like Databricks, Snowflake, and Azure Fabric are designed to coordinate petabyte-scale datasets across large engineering orgs. For focused R&D teams or workloads under 1 TB, distributed clusters introduce network serialization overhead, idle compute billing, and infrastructure complexity without improving query latency.
By co-locating columnar storage and vectorized in-process compute on a single NVMe instance, we eliminate network hops between storage and compute while keeping full control over the runtime.
System Architecture
The entire stack runs on a single Hetzner Cloud VM (CAX21: 4 ARM64 vCPUs, 8GB RAM, local NVMe) at €6/month.
1. Operations & Query Frontend
We built a web interface modeled on the operational views of Azure Data Factory and Databricks SQL:
- Pipeline Monitor: Displays temporal run history, asset lineage, and execution logs for all Dagster jobs.

- DuckDB Query Explorer: Executes interactive analytical SQL directly against local Delta Lake tables with sub-second response times.

2. Local NVMe Delta Lakehouse
Instead of storing Parquet files on remote object storage (S3) and paying per-request API latency on every scan, the medallion layers live directly on the host's local NVMe filesystem under /data/lake:
- Medallion Topology: Standardized Bronze (raw immutable ingestion), Silver (deduplicated, schema-enforced records), and Gold (analytical aggregations) tables.
- Zero-Network I/O: Compute (DuckDB/Polars) reads directly from local NVMe blocks.
- ACID Guarantees: Using
delta-rsgives us atomic transactions, schema evolution, and time-travel snapshots on a POSIX filesystem without running a JVM cluster.
3. Compute Engine: Why DuckDB Over Spark?
In 2015, processing 100GB of financial time-series data required a multi-node Apache Spark cluster because single-node RAM and disk I/O were bottlenecks. On modern hardware, a single node with local NVMe and vectorized execution handles hundreds of millions of rows in-process.
Replacing Spark with DuckDB and Polars eliminated JVM heap tuning, cluster spin-up delays, and inter-node shuffle overhead. Analytical aggregations over full historical NYSE and NASDAQ price histories execute in memory within a strict 8GB RAM envelope.
4. Orchestration & Transformation
- Headless Dagster: Defines asset lineage and dependency graphs in Python, invoked via
systemdtimers and a lightweight local trigger endpoint rather than running a persistent 500MB webserver/daemon pair. - dbt: Manages SQL transformations and schema assertion tests across Silver and Gold tables.
- Docker: Isolates runtime dependencies across ingestion and transformation steps.
5. Reproducible Provisioning with Ansible
The host configuration is defined declaratively in Ansible playbooks, provisioning Docker, UFW firewall rules, systemd timers, and backup cron jobs from a clean Linux image in under 10 minutes without configuration drift.
Failure Modes, CAP Trade-Offs & Mitigations
Running a stateful data platform on a single VM trades away high availability (HA) and automatic partition failover in exchange for zero network overhead and low fixed cost:
- Single Point of Failure: A host outage or datacenter incident takes the platform offline until the VM recovers or is reprovisioned.
- Local Disk Failure: Storing active Delta tables on a single NVMe drive risks data loss on hardware failure unless snapshots are replicated off-host.
Recovery Engineering (RPO & RTO)
Because QuantLens serves batch analytical workloads rather than sub-second transactional trading, we engineered around bounded recovery time rather than multi-node consensus:
- Daily Off-Host Snapshots (
RPO = 24h): Compressed Delta Lake snapshots sync daily to S3-compatible object storage. - Automated Reprovisioning (
RTO < 15m): Ansible playbooks rebuild the entire host environment from scratch and restore the latest object storage snapshot in under 15 minutes. - Idempotent Medallion Rebuilds: Because Bronze ingestion payloads are immutable, Silver and Gold tables can be deterministically recomputed from Bronze at any time.
- External Health Checks: Automated uptime probes alert on failed systemd timer runs or host unreachability.
Compute Economics: Hetzner vs. Hyperscalers
| Provider | Comparable Spec (4 vCPU, 8GB RAM) | Monthly Cost |
|---|---|---|
| Hetzner CAX21 | ARM64 Ampere, local NVMe | ~€6/month |
AWS t3.medium | x86, EBS gp3 | ~€35–45/month |
Azure B2s | x86, Standard SSD | ~€35–40/month |
GCP e2-medium | x86, Standard PD | ~€30–40/month |
For workloads that do not require global edge routing or managed proprietary cloud services, Hetzner provides a 5–7x compute cost reduction, EU data residency (Germany/Finland), and zero egress fees when pairing local NVMe with S3 snapshots.
Horizontal Escape Hatches
Because storage and compute interact strictly through open protocols (Delta Lake + SQL/DataFrame APIs), scaling beyond a single node requires zero data model rewrites:
- Remote Object Storage Cutover: Pointing
DATA_ROOTfrom/data/laketos3://bucket-namedecouples storage capacity from the local NVMe disk; both DuckDB anddelta-rsread remote Delta tables natively. - Read Replicas: Syncing the Gold Delta tables to a secondary read node isolates dashboard query traffic from batch ingestion jobs.
- Warehouse Portability: The Delta Lake tables and
dbtmodels port directly to Databricks or Snowflake if organizational scale eventually requires managed compute governance.
Summary
- Infrastructure Efficiency: Full Bronze/Silver/Gold medallion capabilities on an 8GB RAM instance, cutting baseline platform costs by over 90% compared to managed cloud warehouses.
- In-Process Throughput: Processes historical US equity datasets in-memory via DuckDB and Polars without distributed shuffle overhead.
- Zero Lock-In: Built entirely on open formats (Delta Lake, Parquet, SQL, Ansible) with full data sovereignty.
— Pedro
Founder & Principal Engineer