Apache Spark
- Problem solved: speed up distributed computing by keeping data in memory between steps, and unify batch, SQL, ML and streaming.
- Era: created in 2009 at UC Berkeley's AMPLab, first paper in June 2010, Apache Incubator in June 2013, top-level project in February 2014.
- Created by: Matei Zaharia, with Mosharaf Chowdhury, Michael J. Franklin, Scott Shenker and Ion Stoica (UC Berkeley, AMPLab).
- Category: distributed compute engine.
Historical context
In the late 2000s, MapReduce and Hadoop dominate large-scale processing. Their model is an acyclic data flow: each job reads its inputs from disk and writes its outputs back. Spark's founding paper (HotCloud 2010) points to two poorly served workloads: iterative algorithms in machine learning, where every iteration reloads the same data, and interactive analysis, where every Hive or Pig query costs "tens of seconds" because it launches a new MapReduce job.
The project starts in 2009 at UC Berkeley's AMPLab, the lab that also created Mesos. Spark is in fact first built on top of Mesos. Matei Zaharia co-authors the June 2010 paper with Mosharaf Chowdhury, Michael J. Franklin, Scott Shenker and Ion Stoica: on logistic regression, a Hadoop iteration takes 127 s, against 6 s for Spark once the data is cached. The code is released as open source the same year. The RDD paper (NSDI 2012, Best Paper Award) formalizes the abstraction and reports an early industrial use: at Conviva, a 20-hour report on Hadoop drops to 30 minutes on two Spark machines.
In 2013 the original team founds Databricks to develop Spark, and the project enters the Apache Incubator on 19 June 2013. It graduates on 19 February 2014 with more than 120 contributors from 25 organizations. In the fall of 2014, Databricks shows that Spark is not only an "in-memory" engine: it wins the Daytona GraySort by sorting 100 TB on disk in 23 minutes with 206 machines, against 72 minutes and 2,100 machines for the previous Hadoop record.
Spark then grows beyond the RDD: Spark SQL arrives with 1.0 (May 2014), 2.0 (July 2016) unifies DataFrame and Dataset and launches Structured Streaming, 3.0 (June 2020) adds adaptive execution and notes that Python has become the most widely used language on Spark.
Key idea
An RDD (Resilient Distributed Dataset) is a read-only collection,
partitioned across machines, that can be kept in memory and reused from one
operation to the next. Its fault tolerance does not rely on replicating data
but on lineage: each RDD remembers the coarse-grained transformations
(map, filter, join) that produced it. If a partition is lost, Spark
recomputes it from its parents without rerunning everything.
How it works
- Transformations and actions: transformations (
map,filter,join) are lazy and describe a new RDD; only actions (count,collect,save) trigger computation. - DAG of stages: on each action, the scheduler reads the lineage graph and cuts it into stages. Narrow transformations are pipelined inside a stage; the boundaries are the shuffles required by wide dependencies (grouping, joins).
- Persistence:
persistkeeps an RDD in memory, spilling to disk when RAM runs out. - Libraries: Spark SQL (with the Catalyst optimizer), Structured Streaming, MLlib, GraphX, on top of the same engine.
- Deployment: standalone, YARN, Mesos or EC2 in 2014; Kubernetes is natively supported in 3.0.
val lines = spark.textFile("hdfs://...") // RDD, nothing read yet
val errors = lines.filter(_.contains("ERROR")) // lazy transformation
errors.persist() // keep it in memory
errors.count() // action: computation starts
By the numbers
| Figure | Context | Source |
|---|---|---|
| 127 s vs 6 s | One logistic regression iteration, Hadoop vs Spark with cache (29 GB, 20 EC2 nodes, 2010) | HotCloud 2010 paper |
| 0.5 to 1 s | Interactive query over 39 GB of Wikipedia in memory on 15 machines (2010) | HotCloud 2010 paper |
| 20x | Maximum speedup over Hadoop on iterative applications (2012) | NSDI 2012 paper |
| 14,000 lines | Size of Spark's Scala code (2012) | NSDI 2012 paper |
| 120 and 25 | Developers and organizations contributing during incubation (2013-2014) | ASF press release 2014 |
| 23 min, 206 machines | Sorting 100 TB on disk, vs 72 min and 2,100 machines for Hadoop (2014) | Databricks blog 2014 |
| 440 and 3,400 | Contributors and resolved tickets for Spark 3.0 (2020) | 3.0.0 release notes |
| 5 million | Monthly PySpark downloads on PyPI (2020) | 3.0.0 release notes |
Milestones
- 2009: created at UC Berkeley's AMPLab.
- June 2010: paper "Spark: Cluster Computing with Working Sets" (HotCloud); first open source release in 2010.
- April 2012: RDD paper at NSDI, Best Paper Award.
- 19 June 2013: enters the Apache Incubator.
- 2013: Databricks is founded; first blog post on 27 October 2013.
- 19 February 2014: Apache top-level project (announced on 27 February).
- 30 May 2014: Spark 1.0, API stability and the arrival of Spark SQL.
- 5 November 2014: official Daytona GraySort win.
- 26 July 2016: Spark 2.0 (unified DataFrame and Dataset, Structured Streaming).
- 18 June 2020: Spark 3.0 (adaptive execution, native Kubernetes); Spark 4.0 follows on 23 May 2025.
Did you know?
- The sorting record did not use memory. For GraySort 2014, the whole sort ran on disk (HDFS), without Spark's cache. Databricks presents it as the answer to "one of the most common misconceptions about Spark": Spark was designed from the start to work both in memory and on disk. The record is shared with a UCSD team.
- A bet on the Scala interpreter. As early as 2010, Spark could be driven from a modified Scala interpreter. The authors believed it was "the first system to allow an efficient, general-purpose programming language to be used interactively to process large datasets on a cluster".
- Hadoop's Swiss Army knife. The 2014 ASF press release quotes the nickname coined by The Register: "Hadoop Swiss Army knife".
- Mesos's offspring. Spark was born on top of Mesos, a "cluster operating system" from the same lab, which "greatly reduced the programming effort" according to the 2010 paper.
Strengths and limitations
| Strengths | Limitations |
|---|---|
| Data kept in memory between steps: up to 20x faster than Hadoop on iterative jobs (2012) | Memory-hungry |
| Unifies batch, SQL, ML and streaming on one engine | Tuning can be complex |
| Fault tolerance through lineage, without replicating intermediate data | Less suited to interactive ad hoc SQL than Trino |
| Wide adoption (Alibaba, IBM, Intel, Yahoo cited as early as 2014) | Lineage can grow long: the paper then recommends checkpoints |
What came next
- YARN and Mesos, then Kubernetes, to share the cluster with other engines.
- Table formats (Iceberg, Delta Lake) that it can read and write, often over Parquet files.
- Trino for interactive analytics.
- DataFusion serves as a native execution engine for Spark accelerators (Comet, Blaze).
Sources
raw-data/apache/spark/spark.md- Zaharia et al., "Spark: Cluster Computing with Working Sets", HotCloud 2010, https://www.usenix.org/legacy/event/hotcloud10/tech/full_papers/Zaharia.pdf
- Zaharia et al., "Resilient Distributed Datasets", NSDI 2012, https://www.usenix.org/system/files/conference/nsdi12/nsdi12-final138.pdf
- https://spark.apache.org/research.html
- https://incubator.apache.org/projects/spark.html
- https://news.apache.org/foundation/entry/the_apache_software_foundation_announces50
- https://www.databricks.com/blog/2013/10/27/databricks-and-the-apache-spark-platform.html
- https://www.databricks.com/company/about-us
- https://www.databricks.com/blog/2014/10/10/spark-petabyte-sort.html
- https://www.databricks.com/blog/2014/11/05/spark-officially-sets-a-new-record-in-large-scale-sorting.html
- https://spark.apache.org/news/index.html
- https://spark.apache.org/releases/spark-release-2-0-0.html
- https://spark.apache.org/releases/spark-release-3-0-0.html
- Limitations "memory-hungry" and "tuning can be complex": carried over from the previous version of the page, plausible but unsourced.
- Comparison with Trino on interactive ad hoc SQL: unsourced.
- Named list of Databricks co-founders: to be read from a primary source.
- Origin of the name "Spark": no source found.
- Exact date of the first open source release in 2010.