"Big data is like moving from a minivan to a freight train — same cargo idea, totally different physics."
Learning Objectives
By the end of this module, you will be able to:
- Describe the core dimensions of “big data” and when scale actually matters
- Explain distributed computing in plain language (partitioning, shuffle, parallelism)
- Run basic read/filter/aggregate flows in PySpark
- Compare major cloud data warehouses at a high level
- Map components of the modern data stack to analyst workflows
Do You Actually Need Big Data?
If your data fits in RAM and queries finish in seconds, you might not. Big-data tooling pays off when volume, velocity, or variety breaks single-machine habits.
| Signal | Maybe stay local | Consider distributed / warehouse |
|---|---|---|
| Row count | < few million tidy rows | Billions of events |
| Join complexity | Few tables | Many huge facts |
| Refresh | Ad hoc | Hourly streaming loads |
Concept: Engineering cost rises with scale — don’t borrow complexity before you need it.
1. The V's of Big Data
The Classic 3 V's
| V | Meaning | Analyst angle |
|---|---|---|
| Volume | Lots of bytes | Partitioning, compression |
| Velocity | Arriving fast | Streaming, micro-batches |
| Variety | JSON, logs, images | Schemas, lakes vs warehouses |
When You Need Big Data (and When You Don't)
Need: petabyte logs, global clickstreams, cross-product event joins at raw grain. Don’t need: a 50MB CSV for a class project — Pandas is fine.
Fun Fact: Many teams move to a warehouse before they ever touch Spark — SQL + columnar storage solves a lot.
2. Distributed Computing Concepts
The Core Idea
Split the dataset across machines (partition), run the same operation locally, combine results. MapReduce was the original story; Spark generalizes it with a nicer programming model.
Key Concepts
| Term | Think… |
|---|---|
| Partition | Shard of the table |
| Shuffle | Expensive redistribution for group-by / join |
| Driver | Coordinator process |
| Executor | Worker crunching a partition |
Narrow transformations (filter, map) are cheap; wide (groupBy, join) shuffle data across the network — profile those.
3. Apache Spark (PySpark)
Setup
Local mode for learning; cluster managed by Databricks, EMR, Dataproc in production.
Creating DataFrames
Read Parquet (preferred), CSV, JSON. Schema inference costs a scan — specify schema in production.
Basic Operations
select, filter/where, withColumn — lazy until an action (show, count, write).
Aggregations
groupBy(...).agg(...) — same mental model as SQL/Pandas, different API.
Window Functions in Spark
Window.partitionBy(...).orderBy(...) with rank, sum over, lag — SQL window logic in DataFrames.
SQL in Spark
Register a temp view → spark.sql("SELECT ...") for teams who think in SQL.
Spark Performance Tips
- Prefer Parquet, partition keys aligned with filters
- Avoid collect on huge data
- Watch shuffle volume in Spark UI
Key Example: Minimal Spark session: read, filter, aggregate — the shape of almost every distributed pipeline.
[object Object], pyspark.sql ,[object Object], SparkSession
,[object Object], pyspark.sql ,[object Object], functions ,[object Object], F
spark = SparkSession.builder.appName(,[object Object],).getOrCreate()
df = spark.read.parquet(,[object Object],) ,[object Object],
summary = (
df.,[object Object],(F.col(,[object Object],) == ,[object Object],)
.groupBy(,[object Object],)
.agg(F.,[object Object],(,[object Object],).alias(,[object Object],))
.orderBy(F.desc(,[object Object],))
)
summary.show(,[object Object],)4. Cloud Data Warehouses
Google BigQuery
Serverless SQL; separates storage and compute; great for ad hoc analyst queries at scale. Watch bytes scanned = cost proxy.
Snowflake
Warehouses (compute) spin up/down; separation of storage/compute; strong multi-cloud story.
Amazon Redshift
MPP columnar warehouse; integrates with AWS data lake patterns; RA3 separates storage/compute in newer generations.
Comparison
| BigQuery | Snowflake | Redshift | |
|---|---|---|---|
| Mental model | Serverless queries | Virtual warehouses | Cluster + nodes |
| Analyst UX | SQL + console | SQL + worksheets | SQL + Spectrum to lake |
5. The Modern Data Stack
Typical flow: ingest (Fivetran/Airbyte) → lake/warehouse (Snowflake/BigQuery) → transform (dbt) → BI (Looker/Mode/Metabase). Analysts live in SQL + BI; engineers own pipelines.
| Layer | You might touch… |
|---|---|
| Ingest | Validate landing schemas, SLA on freshness |
| Warehouse | SQL models, cost of scans |
| Transform (dbt) | Documented dimensions, tests on keys |
| BI | Semantic layer vs raw warehouse tables |
Concept: “Modern stack” is less about logos and more about versioned transforms and tested tables before charts.
Practice Exercises
Exercise 1: PySpark Basics (Beginner)
Local Spark: load sample CSV, filter, groupBy, show.
Exercise 2: When to Scale (Intermediate)
For three scenarios, argue laptop vs warehouse vs Spark.
Exercise 3: SQL Across Platforms (Intermediate)
Same GROUP BY in SQLite and in BigQuery docs — note syntax differences.
Exercise 4: Data Format Comparison (Advanced)
Table comparing CSV vs Parquet on size, speed, schema.
Exercise 5: Cloud Warehouse Exploration (Advanced)
Free tier: run one public dataset query; note slots/bytes billed.
Mini-Project: Scalable Analytics Pipeline
Document: source → landing format → partition keys → aggregate table → BI dashboard; include one Spark or SQL snippet and a cost/perf note.
Key Takeaways
- Scale tools to actual data size and query patterns.
- Shuffles/joins dominate distributed cost — design partitions wisely.
- Spark DataFrames ≈ lazy, distributed Pandas-like ops + SQL escape hatch.
- Cloud warehouses often arrive before Spark in maturity curves.
- Modern stack = EL + warehouse + transform + BI.
Resources for Further Learning
Key Takeaway
- Question whether data is truly “big” before adopting heavy tooling.
- Partition and file format choices matter as much as the query text.
- Use Spark when custom distributed logic is needed beyond SQL warehouses.
- Prefer columnar formats (Parquet) for analytics paths.
- Place yourself in the stack: SQL + BI first, Spark when the job demands it.
Next up: Module 11 — Data Storytelling and Communication — making your findings impossible to ignore.