internalsGet Pro

Module 08 · Lesson 6 of 14Pro

Shuffles: the most expensive step in Spark

Level
Intermediate
Topic
Batch processing with Spark
Reading time
17 min

When you finish this page you can

  1. Explain why grouping, joining and repartitioning make Spark move rows between every pair of tasks.
  2. Trace what one shuffled row costs on the map side and the reduce side, from memory to disk to network and back.
  3. Estimate a shuffle’s size from rows, columns and partial aggregation, and say what shrinks it.
  4. Predict what happens to a running job when an executor holding shuffle files disappears.

Builds on 2 lessons

Start with lesson 317 min
  1. Spark architecture: driver, executors and tasks17 min
  2. Lazy evaluation and Spark query plans16 min

Same clicks, 55 times the data moved

is an online store in India. Its apps record about 200 million click events a day: product views, searches, add-to-carts. The events land as Parquet files in S3, one folder per day. Meera, a data engineer on Kartly’s data team, runs Spark jobs over them each night.

Our biggest sale ever · Black Friday

Flat 50% Off

Pro

Continue reading

Unlock every course, now and later

  • System Design, live
  • AI Engineering, live
  • Data Engineering, live
  • Machine Learning Engineering, live
  • Inference Engineering, coming soon
  • AI Research, coming soon
  • Performance Engineering, coming soon
  • Agent & Harness Engineering, coming soon
  • LLM Fine-tuning, coming soon
  • LLM Pre-training & Post-training, coming soon
  • Reinforcement Learning, coming soon
  • AI Infrastructure & Platform Engineering, coming soon
  • AI Evaluation & Safety, coming soon
  • Forward Deployed Engineering, coming soon
  • Cloud Computing, coming soon
  • DevOps, coming soon

50% off · Annual and Lifetime

BLACKFRIDAY50Applied at checkout

Choose a plan