LESSON 30.2
Data lakes, warehouses and Parquet
Analytical storage on object storage with row versus columnar formats, Apache Parquet dictionary encoding, snappy compression, and date-based hive partitioning.
5 min read
Organizations collect vast amounts of telemetry, transaction logs, and customer interactions. Storing and querying this data requires an analytical data architecture that balances cheap long-term retention against high-throughput analytical query performance.
Modern data platforms organize analytical storage around data lakehouses using standardized columnar formats like Apache Parquet.
Data lake vs data warehouse vs lakehouse
Data Warehouse (Snowflake, BigQuery)
- Fully managed, structured SQL with ACID transactions
- High-performance indexing and automatic query optimization
- Expensive proprietary compute and storage pricing
- Requires schema definition before ingesting raw data
Pick it when: Business intelligence dashboards, financial analytics, structured reporting.
Data Lake (S3, GCS, HDFS)
- Extremely inexpensive commodity object storage ($0.02 per GB/month)
- Stores raw unstructured, semi-structured (JSON, CSV, Avro), and binary data
- Lack of transaction support, danger of creating an unorganized 'data swamp'
Pick it when: Raw telemetry landing zone, machine learning training datasets.
Lakehouse (Delta Lake, Apache Iceberg)
- Combines cheap object storage with ACID transactions, time travel, and schema enforcement using open Parquet metadata tables
- Requires table maintenance (compaction, vacuuming)
Pick it when: Modern enterprise big data platforms.
Row-oriented vs columnar storage
Relational databases (PostgreSQL, MySQL) store data in rows: all fields for row 1 are stored together on disk, followed by all fields for row 2. This is optimal for OLTP (e.g. SELECT * FROM users WHERE id = 42).
Analytical queries (OLAP), however, typically aggregate across billions of rows but touch only a few columns:
SELECT country, AVG(amount) FROM transactions WHERE date >= '2026-01-01' GROUP BY country;In row-oriented storage, the engine must scan the entire 1 TB table from disk just to extract two columns. In columnar storage, each column is stored in separate contiguous disk blocks: the query engine reads only the country and amount blocks, reducing disk IO by 90% or more.
Inside Apache Parquet
Apache Parquet is the open-source standard columnar file format for analytical systems:
- Row Groups: Parquet divides a large dataset into logical chunks of rows called Row Groups (typically 128 MB to 512 MB).
- Column Chunks: Within each row group, data for each individual column is stored contiguously.
- Dictionary Encoding: Repeated string values (like country names
US, US, CA, UK) are replaced with small integers (0, 0, 1, 2) and a shared lookup dictionary, reducing storage drastically. - Compression: Columnar values of the same type compress exceptionally well using Snappy, Zstandard, or Gzip.
- Metadata & Statistics: Every Parquet file contains footer metadata storing
minandmaxvalues for each column chunk. If a query filtersWHERE amount > 1000and the row group footer saysmax_amount = 450, the query engine skips reading the entire 128 MB chunk without touching its bytes (Predicate Pushdown).
Hive partitioning and partition pruning
Data lakes organize Parquet files in object storage using hierarchical directory paths:
s3://analytics-bucket/events/year=2026/month=10/day=17/part-001.parquetWhen a user executes a query with WHERE year = 2026 AND month = 10 AND day = 17, the query engine applies partition pruning: it reads only the specific day directory, skipping petabytes of historical files completely.
- Parquet vs raw CSV size reduction
- 75% to 85% storage reduction
- Parquet query speedup vs CSV
- 10x to 50x faster query execution
- Recommended Parquet file size
- 128 MB to 1 GB per file (avoids the small file problem)
- S3 object storage cost
- ~$0.023 per GB per month
Try it
Multi-tenant Analytics Query Platform HLD
Design an analytics lakehouse architecture that ingests raw JSON events and stores partitioned Parquet tables for interactive queries.