When designing a sub-second S3 OLAP engine, pair Iceberg metadata pruning with consistent-hashed NVMe caches, Arrow Flight shuffles, and NVMe spill guards.
TL;DR30-second simplified summary▾
Iceberg manifests cut discovery from 5s to 11 ms, consistent hashing hits 94% NVMe cache locality, Arrow Flight shuffles without serde, and skew splitting + NVMe spill prevent OOMs.
R & E · Requirements, S3 Pruning & NVMe Cache Math.
500 TB of Parquet (~500,000 files at 1 GB/file or 2M files at 256 MB/file) cannot be LISTed from S3 per query (1,000 keys/LIST = 2,000 S3 API calls = 10+ seconds).
Illustrative Sizing: An Iceberg/Delta metadata catalog keeps partition + file min/max stats in Coordinator RAM (~2 GB for 2M files), pruning a typical dashboard query (last 7 days, region='US') down to ~200 MB of actual column chunks! With 50 workers x 2 TB NVMe = 100 TB of aggregate NVMe cache (20% of total 500 TB dataset), consistent-hashed task routing hits local NVMe at ~3 GB/s per worker—reading 200 MB in ~15–40 ms instead of 200+ ms over S3.
Per-Query S3 LIST + Download (5s+) vs. Catalog Prune + Consistent NVMe (<500 ms)
- S3 LIST + Footer GETs take 3–5s
- Zero worker cache locality
- Skewed join OOMs 64 GB RAM
- <15 ms metadata pruning
- >90% local NVMe cache hits
- Dynamic NVMe spill prevents OOM
S · Storage: Consistent-Hashed NVMe Cache & Parquet Coalescing.
If the Coordinator schedules file_42.parquet onto Worker 1 on Query A and Worker 37 on Query B, every worker ends up caching duplicate copies of the same hot files.
The Coordinator assigns (s3_uri, row_group_id) via Bounded-Load Consistent Hashing across the 50 workers. Worker 1 always owns file_42, caching its Parquet Footer + hot Zstd column pages on its 2 TB local NVMe. On a cache miss, the worker issues Coalesced S3 Byte-Range GETs (merging nearby column offsets within 1 MB into one HTTP request) to cut S3 request fees and RTTs.
Iceberg Catalog -> Consistent Hash Affinity -> Worker NVMe -> Coalesced S3
H & A · Coordinator DAG, Arrow Flight Shuffle & BI Streaming.
The SQL Coordinator parses SQL, builds a vectorized physical DAG (Scan -> Filter -> HashJoin -> PartialAgg -> FinalAgg), and dispatches stage tasks to workers.
For small dimension tables (<100 MB), the Coordinator chooses a Broadcast Join (sending the small table once to all 50 workers, zero shuffle on the big fact table!). For large-to-large joins, workers hash-partition output RecordBatches by join key and stream them directly peer-to-peer over Arrow Flight.
BI Client -> Coordinator (Prune) -> Workers (NVMe + Flight Shuffle) -> Result
D · Detailed Design: Skewed-Join Splitting & Dynamic NVMe Spill.
In real analytics, 1% of keys (like tenant_id = 'anonymous' or NULL) often account for 70% of rows. A standard hash shuffle sends all 70% to ONE worker, blowing past its 48 GB RAM limit.
Two defenses eliminate OOMs: (1) Adaptive Skewed-Join Splitting: if runtime stats detect one partition receiving >5x average bytes, split that hot key across K sub-workers (salting the probe side and replicating the hot build key K times); (2) Dynamic Spill-to-NVMe: every operator registers with a per-query MemoryPool. If pool usage crosses 75%, the hash join/aggregation spills its largest in-memory hash partitions to local NVMe as Arrow IPC files and merges them via external sort/hash!
In-Memory Vectorized (<75% RAM) -> Spill Partition to NVMe -> External Merge
- Problem
- How to hit <500 ms p95 over 500 TB S3 Parquet while surviving skewed joins and 100 concurrent users.
- Naive Solution
- Scan S3 directly on every query and hold all hash join tables purely in RAM.
- Why It Fails
- S3 LIST/footer I/O blows past 500 ms immediately, and skewed keys OOM 64 GB workers.
- Alternatives
- Direct S3 + In-Memory-Only vs. Iceberg Prune + Consistent NVMe Cache + Dynamic Spill.
- Engineering Decision
- Prune via cached Iceberg manifests, route tasks via Bounded-Load Consistent Hashing to 2 TB NVMe caches, shuffle over Arrow Flight, and spill to NVMe at 75% RAM.
- Trade-Offs
- Spilling to NVMe slows down extreme skewed queries from <500 ms to a few seconds in exchange for zero OOM crashes.
During a JOIN between events (10B rows) and users (50M rows), 49 workers finish in 200 ms while Worker 17 OOM-crashes because 40% of events have user_id = NULL. How do you fix this?
E & D · Evaluation, Assumptions, Limitations & Glossary.
The <500 ms p95 SLA applies to selective dashboard queries where Iceberg pruning narrows scans to <=1–2 GB and the hot working set fits in the 100 TB NVMe cache.
Assumptions & Limitations: Full-table unpruned scans across all 500 TB (e.g., SELECT COUNT(DISTINCT raw_url) FROM all_5_years) are fundamentally bound by S3/NVMe aggregate bandwidth (~150 GB/s across 50 workers = ~3,300 seconds cold, or minutes warm) and should route to a separate heavy-batch resource group with pre-computed HyperLogLog/rollups.
Coordinator (Iceberg Prune) -> 50 Workers (NVMe + SIMD) -> Arrow Flight -> BI
Practice: Make the trade-off yourself.
Why does reading an Iceberg/Delta metadata manifest beat calling S3 `LIST` + reading Parquet footers at query time?