
Explore the Spark architecture and job structure to see how components interact, then identify common performance issues—data shuffle, data skew, and data spill—and how to tackle them.
Explore spark architecture by identifying the driver, cluster manager, and executors. Learn how the driver creates a spark session, submits jobs, and the resource manager allocates resources and monitors progress.
Explore spark deployment modes—local, client, and cluster—and learn their use cases, trade-offs, and suitability for testing, debugging, interactive development, and production deployments.
Compare cluster mode and client mode in Apache Spark. In cluster mode, the driver and executors reside inside the cluster; in client mode, the driver runs externally and submits jobs.
Spark jobs are submitted by the driver and split into stages and tasks that run in parallel on executors, with lazy execution until actions like count or save trigger them.
Examine the three main performance concerns in Spark—skew, shuffle, and spill—and learn how to identify and mitigate their impact on your jobs.
Understand how shuffle in Spark moves data across the cluster to enable aggregations and joins. Identify memory pressure, spill to disk, and network traffic as common bottlenecks.
Discover how Spark shuffles data to group by a key, creating partitions by color. Learn why shuffles are costly, and how data skew and memory pressure can cause spills.
Identify shuffle by analyzing spark UI shuffle read and write metrics during transformations like group by or join to detect data movement across the cluster and guide mitigation.
Learn how to fix shuffle with broadcast joins in Spark, copy the small table to all executors so the join runs locally and results return to the driver.
Switch from group by to reduce by to minimize shuffle in Spark and boost performance. Reduce by shuffles only summaries, unlike group by which shuffles all data for each key.
Increase spark partitions to maximize parallelism and reduce data shuffled, lowering skew and speeding processing, by setting spark.sql.shuffle.partitions, while noting higher memory and network usage.
Skew occurs when a few partitions hold most of the data, causing uneven workload, reduced parallelism, and higher memory and disk I/O, with updates and deletes worsening distribution.
Explore how skewed data concentrates on the red value, causing a single executor to process more data, triggering memory spills to disk and slowing the Spark job.
Identify skew by grouping by partition id and counting rows to reveal uneven partitions, and inspect Spark UI task times to spot long-running executors signaling shuffle skew.
Learn how to resolve skew in Spark by repartitioning data frames, coalescing with caution, salting keys, and increasing partitions to distribute data more evenly and reduce shuffles.
Explore how spill moves data from RAM to disk and back when partitions exceed memory, including skew, causing performance bottlenecks and higher memory and disk I/O in Apache Spark.
Identify spill in the spark UI by the stage’s spilled data, and prevent it by increasing executor memory or, preferably, repartitioning the data for even distribution using repartition or coalesce.
Wrap up by reviewing the Spark architecture—driver, executor, cluster manager—and deployment modes, then cover jobs, stages, tasks, shuffle, skew, and spill to improve performance.
Spark is a powerful framework for processing large datasets in parallel. But, with the complex architecture come frequent performance issues.
In my experience, it can be frustrating looking everywhere, trying to find a resource online that is worded in such a way that you fully understand the inner workings of Spark and how to address these issues. So, I created this course!
This is not a code-along course. This course assumes you already know how to code in Spark. Here, we're talking about how you resolve the performance issues that you encounter during your development journey! We will walk through all of the theory & you'll have actionable steps to take to resolve your performance issues.
In this course, we will cover off:
The Apache Spark Architecture
The type of deployment modes in Apache Spark
The structure of jobs in Apache Spark
How to handle the three main performance concerns in Spark
If you don't yet know how to code in Spark, you can join my 60 minute crash course in PySpark, here on Udemy.
Let's get to work understanding why your scripts are not performing as you may hope and resolve your performance issues together. Shuffle, Skew and Spill will be concerns of the past after this course!