After learning PySpark, where can I run it? Platforms and resources

Same PySpark recipe, different kitchens: your laptop, a Docker box, free online notebooks, managed cloud platforms and company clusters. What you need, where to run it, and how to choose (facts checked October 2026).

1

Facts as of October 2026. Cloud services rename and change often: check the official docs and pricing pages before you build or quote a number.

πŸ—ΊοΈ Platform table

PlatformTypeCostWho manages the machinesBest forHow you run code
🏠 Laptop (local[*])localfreeyoulearning, small files, unit testspython job.py / Jupyter
🐳 Docker imagelocalfreeyou (image is ready-made)same setup on every laptopdocker run … then notebook / shell
☁️ Google Colabfree onlinefree (paid tiers exist)Google (1 machine)quick practice in a browser!pip install pyspark in a cell
☁️ Kaggle notebooksfree onlinefreeKaggle (1 machine)practice with ready datasets!pip install pyspark in a cell
⚑ Databricks Free Editionfree online, serverlessfree, daily quota, non-commercialDatabrickslearning real Databricks, portfolio projectsnotebook; spark is ready
πŸ–₯️ AWS EMR on EC2managed clusterpay per second for EC2 + EMR feeAWS creates them, you pick machine types and countsbig batch jobs, full controlspark-submit step, EMR Studio notebook
⚑ AWS EMR Serverlessserverlesspay for vCPU / memory usedAWSjobs without cluster sizingstart a job run with your script in S3
πŸ§ͺ AWS Glueserverless ETLpay per DPU-hour (per second billing)AWSS3 ETL jobs, Data CatalogGlue job (script in S3), Glue Studio
πŸ”Ž Athena for Apache Sparkserverless notebookspay per useAWSinteractive Spark on S3 dataAthena / SageMaker Unified Studio notebooks
⚑ Azure Databricksmanagedpay (DBUs + VMs)Databricks on Azuremost Azure Spark jobsnotebooks, Jobs
🧡 Microsoft Fabric Sparkmanaged / SaaSpay (Fabric capacity)Microsoftnew Azure analytics projectsFabric notebooks, Spark job definitions
🏊 Azure Synapse Spark poolsmanagedpay per vCore-hourMicrosoftexisting Synapse estatesSynapse notebooks, Spark job definitions
⚑ GCP Managed Service for Apache Spark (formerly Dataproc)managed clusters or serverlesspay (serverless billed per second)GoogleGCP batch jobs on GCSgcloud batches / jobs submit
⚑ Databricks on AWS / Azure / GCPmanagedpay (DBUs + cloud machines)Databrickslakehouse teams on any cloudnotebooks, Jobs, Lakeflow
🧱 Spark Standalone on your EC2sself-managedpay for EC2 onlyyoulearning cluster internalsspark-submit --master spark://host:7077
☸️ Spark on Kubernetes (EKS / AKS / GKE)self-managedpay for the K8s clusteryou (or your platform team)companies already on Kubernetesspark-submit --master k8s://…, Spark Operator
🏭 On-prem Hadoop YARN (e.g. Cloudera)self-managedown hardware + licencescompany IT teambanks / telcos with data centresspark-submit --master yarn

Notes: Azure HDInsight still exists but Microsoft has stopped investing in it and points customers to Fabric. Microsoft says it has no current plan to retire Synapse, but most new work goes to Fabric. Google renamed Dataproc + Serverless for Apache Spark to Managed Service for Apache Spark; job posts still say "Dataproc". Snowflake Snowpark has a PySpark-like DataFrame API but is not the Spark engine.

πŸŽ’ Resources checklist

🏠 On a laptop

  • β˜•Java JDK: Java 17 or 21 (Spark 4.x; Java 17+ required). Check: java -version
  • πŸ’»Python: 3.10+ for PySpark 4.2 (Spark docs for the next release say 3.11+, so 3.11 or 3.12 is the safest pick)
  • πŸ“¦pyspark package: pip install pyspark brings the Spark jars with it: no separate Spark download for local mode
  • 🧠RAM: 8 GB works for practice, 16 GB is comfortable (teacher guidance, not an official minimum)
  • βš™οΈCPU cores: local[*] uses every core; 1 core = 1 task seat
  • πŸ’ΎDisk: a few GB free for Spark, data and shuffle files
  • ✏️Editor: VS Code or Jupyter; on Windows use WSL2 (Ubuntu) or Docker Desktop

🏒 On a cluster

  • πŸ‘¨β€πŸ³Driver machine: one EC2 machine that plans the job (EMR primary machine)
  • βš™οΈWorker machines: EC2 machines that run executors (EMR core / task machines)
  • πŸͺ£Storage: S3 / ADLS / GCS / HDFS: data lives outside the machines
  • 🧭Cluster manager: Standalone, YARN or Kubernetes (managed services hide this)
  • πŸ“Sizing example: m5.xlarge = 4 vCPU, 16 GiB; leave 1 core for the OS and daemons β†’ 1 executor Γ— 3 cores per machine (pages 10 and 19)
  • πŸ”Access: IAM role so the job can read and write S3

πŸš€ Setup quick-start

Laptop / WSL2

# 1) check Java (need 17 or 21)
java -version

# 2) a virtual environment + PySpark
python3 -m venv .venv
source .venv/bin/activate          # Windows WSL2 / Linux / macOS
pip install pyspark

# 3) check it
python -c "import pyspark; print(pyspark.__version__)"

Colab / Kaggle cell

# Google Colab / Kaggle cell
!pip install pyspark
from pyspark.sql import SparkSession
spark = SparkSession.builder.master("local[*]").getOrCreate()
print(spark.version, spark.sparkContext.defaultParallelism)

Docker

# Jupyter + PySpark in one box (open the 127.0.0.1:8888 address it prints)
docker run -it --rm -p 8888:8888 -v "$PWD":/home/jovyan/work quay.io/jupyter/pyspark-notebook

# Official Spark image, PySpark shell (check tags on Docker Hub)
docker run -it --rm spark:python3 /opt/spark/bin/pyspark

spark-submit

# local test
spark-submit --master "local[*]" job.py

# on an EMR cluster (YARN): 3 worker machines of m5.xlarge, 2 executors each is too many,
# so: 1 executor x 3 cores per machine -> 3 executors
spark-submit --master yarn --deploy-mode cluster \
  --num-executors 3 --executor-cores 3 --executor-memory 9g \
  s3://my-bucket/jobs/job.py

πŸ§ͺ AWS Glue and EMR key terms

TermMeaning (verified October 2026)
DPUAWS Glue unit of power: 1 DPU = 4 vCPU + 16 GB memory
Glue worker typesG.1X = 1 DPU (4 vCPU, 16 GB), G.2X = 2 DPU, G.4X = 4, G.8X = 8, G.12X = 12, G.16X = 16; R.1X–R.8X are memory-optimized (M-DPU = 4 vCPU + 32 GB)
Glue version ↔ SparkGlue 5.1 = Spark 3.5.6, Python 3.11, Scala 2.12.18; Glue 5.0 = Spark 3.5.4
EMR release ↔ SparkEMR 7.14 (Sep 2026) = Spark 3.5.8; new emr-spark-8.1.0 (Sep 2026, Long Term Support to Sep 2029) = Spark 4.1.1, Python 3.11 / 3.13, Java 17 default
EMR machine rolesprimary machine (driver side, cluster manager), core machines (run tasks + HDFS), task machines (run tasks only)
EMR Serverlessyou create an application with a release label and submit job runs; AWS picks the workers
Athena for Sparktwo release versions: PySpark engine version 3 (Spark 3.2.1) and Apache Spark 3.5 (based on EMR 7.12, Spark 3.5.6) for SageMaker Unified Studio notebooks

Costs: Glue bills per DPU-hour, EMR bills per second for the EC2 machines plus an EMR fee, serverless products bill for what the job uses. We do not quote prices here: check the AWS, Azure and Google pricing pages for your region.

🧭 Which one to choose?

GoalUse
πŸŽ“ Learninglaptop local[*], Colab / Kaggle, Databricks Free Edition
πŸ’Ό Interview / portfolio projectDatabricks Free Edition + a small AWS project: CSV in S3 β†’ Glue (or EMR Serverless) PySpark job β†’ Parquet in S3
🏒 Company jobwhatever the company uses: EMR, Glue, Databricks, Fabric / Synapse, Dataproc (Managed Service for Apache Spark)

🎀 Interview Q&A

πŸ”¬ Real local run (the script from step 4)

Ran once in the sandbox: Java 21.0.12.1, Python 3.13.16, PySpark 4.2.0, master local[*], 2 cores, CareWell file healthcare_dataset_1000.csv (1,000 rows), 41.0 s including start-up.

where_to_run_local.py

import subprocess, sys, os
os.environ["PYSPARK_PYTHON"] = sys.executable
j = subprocess.run(["java", "-version"], capture_output=True, text=True).stderr
print("java   :", [l for l in j.splitlines() if "version" in l][0])
print("python :", sys.version.split()[0])
import pyspark
from pyspark.sql import SparkSession, functions as F
print("pyspark:", pyspark.__version__)
spark = (SparkSession.builder.master("local[*]")   # laptop: use all cores
         .appName("where-to-run").getOrCreate())
sc = spark.sparkContext
print("master :", sc.master)
print("cores  :", sc.defaultParallelism)
df = spark.read.csv("healthcare_dataset_1000.csv",
                    header=True, inferSchema=True)
print("rows   :", df.count())
(df.groupBy("city").count()
   .orderBy(F.desc("count")).show(3))
spark.stop()
java   : openjdk version "21.0.12.1" 2026-08-18
python : 3.13.16
pyspark: 4.2.0
master : local[*]
cores  : 2
rows   : 1000
+---------+-----+
|     city|count|
+---------+-----+
|    Delhi|   78|
|Bangalore|   77|
|  Chennai|   77|
+---------+-----+
only showing top 3 rows

The steps in words

Sources (checked October 2026)