Apache Spark
The general-purpose distributed engine for large batch jobs, streaming and machine learning, in Python, SQL, Scala, Java or R.
- What it is
- Query engines,Stream processing
- Type
- Open source
- Made by
- Apache Software Foundation
- License
- Apache 2.0
- Facts checked
- 5 October 2026
What it is
A Spark application has a driver, which turns your DataFrame code or SQL into a plan of stages, and executors, which run each stage as many parallel tasks, one per partition of the data. Between stages, data is shuffled across the network, and it spills to disk when it doesn’t fit in memory, so a job can process far more data than the cluster has RAM. If an executor dies, Spark recomputes the partitions it lost. The same engine runs batch jobs, Structured Streaming and MLlib.
Spark runs on Kubernetes, YARN or its own standalone cluster manager, and as managed services such as Databricks, Amazon EMR, AWS Glue and Google Cloud’s Managed Service for Apache Spark (formerly Dataproc). Table formats plug in as libraries: Iceberg, Delta Lake and Hudi each ship a Spark runtime. Spark 4.0 (May 2025) made ANSI SQL mode the default, added a VARIANT type for semi-structured data and moved to Java 17 and Scala 2.13. Spark Connect lets thin clients, including a 1.5 MB Python client, use a remote cluster. The current release is 4.2.0, from July 2026.
Why teams pick it
- One engine for ETL, SQL, streaming and machine learning
- Scales from a laptop to clusters of thousands of nodes, and recomputes lost partitions when an executor fails
- Iceberg, Delta Lake and Hudi each ship a Spark integration that reads and writes their tables
- Managed services on every major cloud, such as Amazon EMR, Google Cloud’s Managed Service for Apache Spark (formerly Dataproc) and Databricks
Watch out for
- Built for clusters: each application starts its own driver and executor processes before any work begins
- Tuning shuffles, partition counts and memory is a skill of its own; skewed keys cause stragglers and out-of-memory errors
- Spark 4 dropped Java 8 and 11 and Scala 2.12, so upgrading from 3.x means dependency work
Alternatives
What all query engines have in common →
Amazon AthenaAWSAWS’s serverless SQL engine for data in S3: no cluster to run, and on-demand queries cost $5 per TB scanned.
Apache CalciteOpen sourceA Java framework with everything a database needs to understand a query (SQL parser, validator, relational algebra and a rule-based, cost-based optimizer) but no storage of its own, which Hive, Flink, Druid, Dremio, Beam and many other systems embed as their SQL front end and planner.
Apache ZeppelinOpen sourceA self-hosted web notebook where each paragraph runs through an interpreter: Spark, Flink, JDBC, Python and more. Maintained, but behind Jupyter and Databricks in reach.
GizmoSQLOpen sourceA database server that wraps DuckDB (or SQLite) and serves it to many clients over Arrow Flight SQL, with TLS and authentication.
HotdataCommercialA managed SQL engine for AI agents, built in Rust on Apache DataFusion and Arrow: each agent gets short-lived “instant databases” to load data into, then runs read-only SQL, vector, full-text and geospatial queries over an HTTP API or CLI.
IbisOpen sourceA Python dataframe API that compiles to SQL, so the same code runs on DuckDB on a laptop and on BigQuery, Snowflake, PostgreSQL or more than 20 other engines.
Spice.ai OSSOpen sourceA single-binary SQL engine in Rust, built on DataFusion and Arrow, that federates queries across databases, warehouses and lakes, keeps hot datasets in a local accelerated copy, and adds search and LLM APIs on top.
VeloxOpen sourceMeta’s open-source C++ execution engine library: it takes an already-optimized query plan and runs it with vectorized operators, and it is the engine inside Presto’s C++ workers (Prestissimo) and Apache Gluten’s native Spark.How it fits with other technologies
What Apache Spark uses
- Apache Sparkreads and writes tables inApache Iceberg
- Apache Sparkreads and writes tables inDelta Lake
- Apache Sparkreads and writes tables inApache Hudi
- Apache Sparkreads and writes tables inLance
- Apache Sparkreads and writesApache Parquet
- Apache Sparkreads and writes streams inApache Kafka
- Apache Sparkreads and writes files inAmazon S3
What uses Apache Spark
- Apache Flussis read and written in batch and streams byApache Spark
- Apache Ozoneacts as a Hadoop file system forApache Spark
- RocksDBis a streaming state store forApache Spark
- Apache Cassandrais read and written, via a connector, byApache Spark
- Apache HBaseis read and written, via hbase-spark, byApache Spark
- ScyllaDBis read and written, via a connector, byApache Spark
- ArangoDBhas a Spark data source connector forApache Spark
- Neo4jhas an official connector forApache Spark
- Apache IoTDBis read and written as DataFrames byApache Spark
- QuestDBis read and written over JDBC byApache Spark
- Apache ORCis read and written natively byApache Spark
- Puffinholds deletion vectors and sketches fromApache Spark
- Vortexis read and written, via a connector, byApache Spark
- Apache Arrowmoves data between JVM and Python forApache Spark
- Apache Paimonis read and written, in batch or streams, byApache Spark
- Apache XTableruns as a library inside jobs onApache Spark
- Apache Polarisserves Iceberg tables toApache Spark
- Cloudflare Basin Catalogserves Iceberg tables toApache Spark
- Lakekeeperserves Iceberg tables toApache Spark
- Project Nessieadds branch and merge SQL commands toApache Spark
- Unity Catalogserves tables over open APIs toApache Spark
- Apache DataFusionruns jobs faster, through Comet, forApache Spark
- Apache DataFusion Cometaccelerates, as a plugin,Apache Spark
- Apache Hadoopschedules jobs, through YARN, forApache Spark
- Apache Hiveserves table metadata, via HMS, toApache Spark
- Apache Pigcan run scripts as jobs onApache Spark
- Apache Zeppelinruns Scala, Python and SQL paragraphs onApache Spark
- Ibiscan run expressions on PySpark withApache Spark
- Presto (PrestoDB)can run queries as jobs onApache Spark
- Veloxruns queries, through Apache Gluten, forApache Spark
- Alibaba Cloud Hologrestakes high-throughput writes fromApache Spark
- Apache Dorisis read and written, via a connector, byApache Spark
- AWS Lake Formationis enforced in EMR and Glue jobs byApache Spark
- Amazon S3 Tablesis read and written byApache Spark
- Apache Amororuns optimizers and its SQL terminal onApache Spark
- Databricksruns a managed, optimisedApache Spark
- Dremioshares Iceberg tables via its catalog withApache Spark
Stream a Kafka topic into an Iceberg table with Structured Streaming · python
from pyspark.sql import SparkSession, functions as F
spark = SparkSession.builder.appName("orders-stream").getOrCreate()
orders = (spark.readStream.format("kafka")
.option("kafka.bootstrap.servers", "kafka:9092")
.option("subscribe", "orders")
.load()
.select(F.from_json(F.col("value").cast("string"),
"order_id BIGINT, amount DECIMAL(10,2), ts TIMESTAMP").alias("o"))
.select("o.*"))
(orders.writeStream.format("iceberg")
.option("checkpointLocation", "s3://acme-lake/checkpoints/orders")
.trigger(processingTime="1 minute")
.toTable("lake.sales.orders"))See it in a real stack
Open lakehouse on Iceberg →Benchmarks
How to read a benchmark →Where it came from2009–2026
By 2009, Hadoop MapReduce was the standard way to process big data on a cluster, but it had one habit that hurt: every job read its input from disk and wrote its output back. Machine learning algorithms that pass over the same data dozens of times reloaded it on every pass, and an analyst running ad-hoc queries through Hive or Pig waited tens of seconds for each one, because each query was a separate MapReduce job.
Spark was created that year in UC Berkeley’s AMPLab by Matei Zaharia, working with Ion Stoica, Scott Shenker and others. The idea was to keep a working set of data in memory across many parallel operations while keeping MapReduce’s scalability and fault tolerance. The first paper, at HotCloud 2010, reported Spark running iterative machine learning 10x faster than Hadoop and scanning a 39 GB dataset interactively with sub-second latency. The code was released under a BSD licence in 2010, the 2012 NSDI paper on Resilient Distributed Datasets won Best Paper, and in 2013 the creators founded Databricks and moved Spark to Apache.
Libraries for SQL, streaming, machine learning and graphs grew on top of the same core.
Why it’s built this way
- Keep data in memory between steps
- Iterative algorithms and repeated queries spent most of their time rereading the same input from disk. Caching a dataset in RAM across a cluster removed that cost for multi-pass work.
- Recover lost data from lineage, not replicas
- Replicating every in-memory dataset would double memory use and network traffic. An RDD instead remembers the coarse transformations (
map,join,groupBy) that built it, so Spark can recompute just a lost partition. - Written in Scala, usable from an interactive shell
- Scala ran on the JVM next to Hadoop but offered functional operations and closures that could be shipped to workers. A modified Scala interpreter let users explore large datasets on a cluster interactively.
- One engine for batch, SQL, streaming and ML
- Instead of separate systems for each workload, Shark (later Spark SQL), Spark Streaming, MLlib and GraphX were built on the same execution core, so data didn’t have to move between systems.
Timeline
- 2009
Spark created at UC Berkeley’s AMPLab
- 2010
HotCloud paper in June; BSD licence added to the code in December
- 2013
Creators found Databricks; Spark enters the Apache Incubator in June
- 2014
Top-level Apache project in February; 1.0 in May; sets a sorting record
- 2016
Spark 2.0 unifies DataFrames and Datasets and previews Structured Streaming
- 2025
Spark 4.0 makes ANSI SQL the default and adds
VARIANT - 2026
Spark 4.2 adds geospatial types and change data capture
- Zaharia et al.: Spark, Cluster Computing with Working Sets (HotCloud 2010)
- Zaharia et al.: Resilient Distributed Datasets (NSDI 2012)
- Apache Spark: Research (papers and Best Paper Award)
- Apache Spark GitHub: Added BSD license (Dec 2010)
- Apache Incubator: Spark incubation status
- ASF: Apache Spark becomes a top-level project, created in 2009 at AMPLab (Feb 2014)
- Databricks blog: Spark sets a new record in large-scale sorting (Nov 2014)
- Spark news: release announcements (1.0.0, 2.0.0, 4.0.0, 4.2.0)
- Spark 2.0.0 release notes (Jul 2016)
- Spark 4.2.0 release notes (Jul 2026)
Sources17 · facts checked 5 October 2026
- Spark docs: Cluster mode overview (driver, executors, cluster managers)
- Spark docs: RDD programming guide (partitions, fault tolerance)
- Apache Spark FAQ (cluster sizes, spilling to disk)
- Spark docs: Tuning
- Spark docs: SQL performance tuning (skew join handling)
- Spark docs: Spark Connect overview
- Spark docs: Structured Streaming and Kafka integration
- Spark 4.0.0 release notes (ANSI mode, VARIANT, JDK 17, Scala 2.13)
- Spark news (release announcements)
- Apache Iceberg docs: Spark getting started
- Apache Iceberg docs: Spark Structured Streaming
- Delta Lake docs: Quickstart with Spark
- Apache Hudi docs: Spark quick start
- Amazon EMR docs: Apache Spark
- AWS Glue docs: What is AWS Glue?
- Google Cloud docs: Managed Service for Apache Spark (formerly Dataproc) overview
- Databricks docs: What is Databricks?