Apache Spark Runtime Architecture

Spark tutorial · PySpark.in

What is Apache Spark?

Apache Spark is a distributed computing framework.

That means:

 You can run Spark on your local machine (for testing), but in production, Spark applications   run  on clusters.

What is a Cluster?

A cluster is a group of networked machines (called worker nodes) that work together.

 Example Cluster:

Cluster Managers in Spark

A Cluster Manager handles resource allocation (CPU + memory).

Most commonly used:

  1. Hadoop YARN

  2. Kubernetes

Others: Apache Mesos, Spark Standalone
(But YARN + Kubernetes cover 90%+ use cases).

Submitting a Spark Application

 Step 1: Request Sent to Cluster Manager

 Step 2: Application Master (AM) Created

 Step 3: Driver Program Starts

Step 4: Executors Run Tasks

Step 5: Job Completion

Simplified Flow

  1. spark-submit → Sends job to Cluster Manager

  2. Cluster Manager (YARN) → Starts Application Master

  3. Application Master → Launches Driver Program

  4. Driver Program → Requests Executors & distributes tasks

  5. Executors → Run tasks and return results

  6. Application Ends → Resources released

Note:

More Spark tutorials

All tutorials · Try the free PySpark compiler · Practice challenges