“Better” depends on the objective function you are optimizing.
Think of a tabular data set as a very large matrix 𝐗 ∈ ℝ^{n×d}.
Parquet and Arrow answer two different, but complementary, optimization problems on 𝐗:
• min IO(𝐗) subject to persisting 𝐗 on disk → Parquet
• min t_mem-to-cpu(𝐗) subject to 𝐗 already being in RAM → Arrow
Below is a deep‐dive framed for a mathematically minded reader.
- Formal view of the two formats
| Object | Mathematical abstraction |
|---|
| Parquet | A block–wise compressed partition of 𝐗 on secondary storage. 𝐗 is first column-partitioned, then broken into row groups (≈1 MB–1 GB each). Each block is encoded → compressed → written. |
| Arrow (IPC/Feather) | A zero-copy, column-major buffer layout of 𝐗 in primary memory (or a memory-mappable file) with auxiliary metadata for types, offsets, & null bitmaps. |
Parquet = Σ_{g=1}^{G} Σ_{c=1}^{d} Σ_{p=1}^{P_{g,c}} ( compressed_page_{g,c,p} )
Arrow = { buffers_{c} ∈ ℝ^{n} | c=1,…,d } ∪ {validity bitmaps, offset buffers}
- Encoding/Compression pipeline (Parquet) vs. Buffer semantics (Arrow)
| Step | Parquet | Arrow |
|---|
| Level 1 | Column Chunk: all values of column c in row group g | 1 typed buffer (values) |
| Level 2 | Page (≈64 kB–1 MB): split to fit cache & seek size | Same buffer (no extra hierarchy) |
| Encoding | Dictionary, RLE, Delta, Byte-Stream-Split, Adaptive Run-Length + Bit-Packing | None; data is stored raw in native endianness |
| Compression | Snappy, ZSTD, Brotli, Gzip (after encoding) | Optional (rare, often left uncompressed to stay zero-copy) |
| Null representation | Repetition/definition levels (nested RLE) | 1-bit validity bitmap buffer |
| Read path | IO → Decompress → Decode → Materialize | mmap / shared memory → direct CPU access |
| Write path | Encode → Compress → IO | memcpy (or zero-copy) → spill if needed |
- Complexity sketch (single column, length n)
| Quantity | Parquet | Arrow |
|---|
| Persistent size | Θ(n · H(𝐗_c)) (H=empirical entropy) | Θ(n) (rarely compressed) |
| Cold-scan cost | T_IO + T_decompress + T_decode ≈ n·(α/HBW + β) | T_IO (mmap) + negligible decoding |
| Random row i | O(log n) seek + decompress page | O(1) (direct pointer arithmetic) |
| Vectorized ops | Need materialization into Arrow-like arrays | Native; column already SIMD-friendly |
| Streaming write | CPU-heavy (encoding+compression) | O(1) append (allocate-once, fill) |
Interpretation: Parquet minimizes number of bytes (IO), Arrow minimizes CPU cycles after bytes are already in RAM.
- Cache/CPU geometry
• Arrow arranges each column as one contiguous, 8/16/32-byte aligned buffer → perfect for SIMD (AVX-512) and cache-line prefetchers.
• Parquet’s pages are <1 MB so that after decompression they still often fit in L3; however you pay for decode latencies.
- Inter-process & inter-language sharing
Arrow’s metadata (Schema + FieldNodes) makes the same memory region interpretable by C++, Rust, Python, Go, JVM without copy: you can fork() and slice subsets in O(1).
Parquet is language-agnostic only after re-reading from disk; sharing incurs at least decompression.
- When does each dominate?
| Use case | Winner | Reasoning |
|---|
| Cold analytics on terabytes (Spark, Hive) | Parquet | IO dominates; can skip unrelated columns & row groups (predicate pushdown). |
| Micro-services passing frames (C++ ↔ Py) | Arrow | Zero-copy buffers; ~1 ns cost for a pointer share vs. ms for (de)compression. |
| Real-time OLAP on flights of data (DuckDB) | Arrow (internal) + Parquet (storage) | Engine reads Parquet once, keeps Arrow in buffer cache. |
| Archival / lake storage | Parquet | 2-5× smaller than Arrow; cheaper S3 bill. |
| Interactive data science (Pandas ↔ R) | Arrow | Feather/IPC opens in 10–100 ms; Parquet 3–10× slower on small files. |
- Typical empirical ratios
| Metric (float64 columns, 10⁸ rows) | Parquet (Snappy) | Arrow (raw) |
|---|
| On-disk size | 8.0 GB → 2.2 GB | 8.0 GB |
| Full-scan wall-clock (SSD 3 GB/s) | 1.4 s | 3.0 s (because 3× more bytes) |
| After 1st read (cache hot) | 0.9 s (still decode) | 0.35 s |
| Random access latency (row-major) | 0.5–2 ms | 50–100 ns |
- TL;DR Cheat Sheet
If you view your data set as
• a measure to integrate over many times → store compressed (Parquet)
• a tensor for repeated linear algebra in RAM → keep in canonical column form (Arrow)
Therefore:
– For storage, interchange over the network, and “write once → read many” workloads → Parquet.
– For in-memory analytics, cross-language data frames, GPU hand-off, or any pipeline where CPU cycles matter more than bytes on disk → Arrow.
Mathematically you can think of Parquet as minimizing ‖𝐗‖₀ – it sparsifies information via entropy coding – while Arrow minimizes the operator norm of the copy operator; i.e., it makes the identity map id: buffer ↦ buffer as cheap as possible (≈0).
So neither format strictly dominates; they solve orthogonal optimization problems in the data-engineering space.