Interview's MateSystem Design
Interview's Mate

System Design

Architecture & trade-offs

Visualizer

DSA Visualizer
All 32 lessons
Custom Playground
Try your own examples

Learning

System Design
31 architecture topics
SQL Learning
160 foundations → production topics
AI Engineering
160 LLM → backend topics
Data Science
160 Python → MLOps topics
Data Engineer
160 SQL → streaming topics
Docker
160 Docker learning topics
Kubernetes
160 K8s fundamentals → cloud
Java LearnSoon
Coming soon
Python Learn
Interview Q&A & internals
JavaScript Learn
Closures, async & DOM Q&A
Tech Learn
Search, practise & track Q&A
AI DSA Practice
Solve coding problems
Theme
Home
System Design topics
Lesson 14/ 31
Storage, Caching & Search

Data Warehousing & Lakes

Separate analytical OLAP queries from live OLTP traffic using columnar storage and ETL/ELT.

IntermediateOLTP vs OLAP · Columnar · Lakehouse3 quiz questions0/2 subtopics done
Practice in AI HLD
In plain wordsDiagramTheorySubtopics (2)Step by stepWhen to use itInterview cluesMistakes to avoidQuiz (3)Practice
Deep-dive subtopics (2) - 0/2 completed
OLTP vs. OLAP & Columnar Storage

Why row stores power user traffic while columnar stores power analytics.

Beginner
ETL, ELT & Lakehouse (Iceberg / Delta)

Move raw data safely into S3 data lakes with ACID table formats.

Intermediate

In plain words

A data warehouse is a big, organized store built for analysis and reports. A data lake is a cheaper place to dump raw data of any kind for later use.

Think of it like…

Live checkout registers (OLTP) record each receipt quickly; end-of-day accounting ledgers (OLAP) summarize columns across the entire year.

Where you’ve seen it

Every night, Uber copies trip data into a warehouse so analysts can answer questions like "which cities grew fastest this month?" without slowing the live app.

Words you’ll hear

OLTP vs OLAP
OLTP serves live app traffic; OLAP runs big analytical queries.
ETL / ELT
Extract, transform, load: moving data from apps into the warehouse.
Columnar storage
Storing data by column so summing one column is very fast.
Data lake
Cheap storage (like S3) holding raw files in many formats.

Visual diagram

Loading interactive diagram
Loading interactive exercise

Theory & deep dive

Row-oriented OLTP vs. Column-oriented OLAP

Your live application database (OLTP) fetches one customer order at a time (SELECT * WHERE id=55), so storing all fields of one row together on disk is super fast.

An analytics report (SELECT AVG(price) FROM orders WHERE year=2026 over 2 billion rows) only needs 2 columns out of 50! A columnar store (Parquet, BigQuery, Snowflake, ClickHouse) stores each column contiguously on disk - skipping the other 48 columns and compressing repeated values by 10×.

Key takeaway: Never run heavy GROUP BY analytics over billions of rows on your live OLTP production database.

How it works, step by step

Step 1 of 4
Ingestion (CDC / Streams)

1. Capture events & DB changes asynchronously

Stream clickstreams via Kafka and database changes via CDC into object storage or staging tables without querying live OLTP tables directly.

Zero analytical query load on production user databases
Key numbers at this step
Transport
Kafka / Firehose
DB Capture
CDC (Debezium)

When to use it & trade-offs

What it is

Data warehouses and lakes store historical events in column-oriented formats (like Parquet) for fast aggregations across billions of rows without impacting production OLTP databases.

Why it matters: Running SELECT AVG(price) GROUP BY country over 500M rows on your live checkout database locks pages and degrades user latency.

When to reach for it

  • Clickstream analytics, ad impression counting, billing rollups, and BI dashboards
  • Training ML models on years of historical events without touching OLTP
  • Real-time OLAP (ClickHouse / Druid / Pinot) for sub-second user-facing analytics

When to avoid or be careful

  • Pointing Tableau/Looker directly at your production primary OLTP database
  • Writing thousands of tiny 5 KB Parquet files per minute without compaction

OLTP vs. OLAP vs. Data Lakehouse

OLTP Database (Postgres, MySQL)
Best for: Point reads/writes, transactions, live user requests

Strengths: Row-oriented layout updates single records in milliseconds with ACID.

Watch out: Scanning millions of rows for analytics thrashes I/O and cache.

Cloud Data Warehouse (Snowflake, BigQuery)
Best for: Structured SQL analytics, BI dashboards, joins across history

Strengths: Columnar vectorized execution, separation of compute & storage.

Watch out: Not meant for high-QPS single-row updates or <10 ms user-facing reads.

Data Lakehouse (S3 + Iceberg/Delta + Spark/Trino)
Best for: Petabyte raw logs, ML training data, open-format governance

Strengths: Cheap object storage with ACID transactions, schema evolution, and time travel.

Watch out: Requires managing compaction (small-files problem) and query engines.

Interview signals & numbers to know

When this topic comes up

  • analytics dashboard
  • clickstream
  • petabyte logs
  • reporting queries
  • OLAP

Benchmarks & rules of thumb

Parquet compression vs JSON -
5–15× smaller
Ideal Parquet file size -
128 MB – 1 GB
OLTP target latency -
<20 ms
OLAP query latency -
100 ms – 10s

Common mistakes & follow-ups

Common interview mistakes

  • Creating the “small files problem” by flushing tiny files every second to S3 without compaction
  • Running heavy SELECT * queries on columnar warehouses (defeats column pruning and spikes cost)
  • Using row-oriented DBs for billion-row time-range aggregations

Likely interviewer follow-ups

  • Why are columnar formats like Parquet vastly faster than row-based storage for SUM(amount)?
  • What is the “small files problem” in data lakes and how do Iceberg/Delta fix it?
  • When would you pick ClickHouse/Pinot over Snowflake or BigQuery?
Interview tip: Whenever a prompt asks for both live product features and heavy analytics/dashboards, split OLTP from an async ingestion → columnar OLAP pipeline.

Knowledge check

Loading quiz

Put it into practice

Design full architectures with AI feedback

Apply Data Warehousing & Lakes inside real High-Level Design prompts or review Q&A flashcards.

Open AI HLD Practice →SD Interview Q&A
Previous topic
Search & Inverted Indexing
Next topic
CAP Theorem & PACELC