internalsGet Pro

Data Engineering · Module 08

Batch processing with Spark

Lessons
14
Free
0
Reading
~4 h

Your progress

0 / 14 lessons done

Sign in to track

Lessons

  1. Distributed batch processing: beyond one machineEvery growing data team reaches a night when one job no longer finishes in its window on the biggest server it has. Knowing what a cluster actually changes, and what it costs, decides whether you add machines or fix the job.13 min
  2. MapReduce: the idea behind big dataEvery Spark job, warehouse GROUP BY and distributed join still splits work the way MapReduce did: work on pieces, move records with the same key together, then combine them. Knowing that shape tells you where a big job spends its time and why it fails.17 min
  3. Spark architecture: driver, executors and tasksMost Spark failures and slow jobs make sense once you know which process holds what: a driver out of memory, a stage stuck on one task, an executor lost halfway. Every Spark setting you tune later is a setting for one of these processes.17 min
  4. Spark DataFrames and Spark SQLAlmost every Spark job today is written with DataFrames or Spark SQL. Knowing what runs on the cluster and what drags data back into one Python process decides whether a job finishes in minutes or dies on the first full day of data.16 min
  5. Lazy evaluation and Spark query plansA Spark job’s cost is decided by the plan Spark builds, not by the order of your lines. Reading that plan is how you catch a job that reads thirteen months of data to answer a question about one week.16 min
  6. Shuffles: the most expensive step in SparkMost slow or failing Spark jobs are slow or failing in a shuffle. Knowing what a shuffle writes, sends and reads lets you look at a query and say how much data it will move before you run it on a billion rows.17 min
  7. Case: LinkedIn’s push-based shuffle for SparkShuffle failures and slow shuffle reads are among the most common reasons a large Spark job misses its deadline. LinkedIn’s account shows where that pain comes from at petabyte scale, and which parts of the fix apply to a much smaller platform.17 min
  8. Partitions and parallelism in SparkA Spark job is only as parallel as its number of partitions. Too few and paid-for cores sit idle while one task runs for hours; too many and the job drowns in tiny tasks and tiny files. Every slow or costly Spark job you debug starts with this number.17 min
  9. Joins at scale: broadcast and sort-mergeAlmost every Spark job joins a large fact table to dimensions. Choosing how the rows meet decides whether the job moves 2 GB or 40 GB over the network, and whether it finishes or fails at 2 a.m.17 min
  10. Data skew: when one task does all the workReal data is never even: a sale, a big seller or a pile of NULL keys sends most rows to one task. Adding machines doesn’t help, so a job that ran in minutes for months can take an hour on the one night the business needs it most.18 min
  11. Caching and memory in SparkA Spark job that reads the same data three times costs three times the reads, and a cache that doesn’t fit costs more than no cache at all. Knowing how an executor splits its memory tells you which one you have before the job fails at 03:00.18 min
  12. Writing efficient Spark jobsMost slow Spark jobs aren’t slow because the cluster is too small. They read data they don’t need, push rows through Python, run the same input several times or write thousands of tiny files. Each of these shows up in the plan before the job runs, and each fix is a few lines.18 min
  13. Reading the Spark UI to debug jobsA Spark job that runs twice as long as yesterday rarely says why in its logs. The Spark UI shows where every second went, task by task, and reading it is how you avoid paying for executors that would not help.17 min
  14. Design: a nightly job over a billion ordersMost companies end up with a few batch jobs that read all of their history every night. Whether those jobs finish on time, and whether their numbers can be trusted after a crash, decides whether the morning report and the models that depend on them are right.28 min

Practise with

No tools or paper guides for this module yet.

Terms this module teaches 47

Open glossary

Action (Spark)

A call that needs a real result, such as count, collect or a write; it makes Spark run the steps recorded so far.