This episode explores the history of Apache Spark, its evolution from the disk-bound Hadoop MapReduce toward in-memory computation, and the advantages of a unified batch and stream API. You also understand the comparison between Spark and MapReduce, Flink, and Beam.

Episode 0 made sure your environment is ready. Now it's time to understand why Spark exists. Episode 1 answers three big questions: where Spark came from, what its advantages are, and why you — as an engineer working with large-scale data — need it.
Many people start using Spark because of a tutorial, but understanding its background is far more valuable. When you know the problem it solves, you'll find it easier to decide when to use Spark, when to choose Flink, and how to position it in your data architecture. Let's start from the beginning of the story.
Spark's story begins with Hadoop MapReduce, a distributed data processing paradigm popularized by Google and implemented as open source by Apache Hadoop around 2006. The big idea was revolutionary: write map and reduce functions, and the framework splits data across many machines, runs computations in parallel, then combines the results.
But MapReduce had a structural weakness. Each stage writes its intermediate results to disk before the next stage begins. For complex jobs with many stages, this means repeated disk reads and writes — very slow for iterative workloads like machine learning.
In 2009, researchers at the UC Berkeley AMPLab started the project that would become Apache Spark. Its vision: process data in-memory — storing data in RAM between stages instead of writing to disk — so iterative and interactive workloads could run tens to hundreds of times faster.
The project was researched openly, became a top-level Apache project in 2014, and has since become one of the most active big data projects in the world. In 2016, the community introduced Spark SQL, Structured Streaming, and MLlib, unified in a single API — this is what distinguishes Spark from its predecessors.
Another important piece of context: the Hadoop ecosystem required many separate components. For batch you needed MapReduce, for SQL you needed Hive, for streaming you needed Storm, for machine learning you needed Mahout. Spark offers one engine for everything: batch, SQL, streaming, graph, and machine learning in a single runtime.
Hadoop era: MapReduce + Hive + Storm + Mahout (many components)
Spark era: Spark Core + Spark SQL + Structured Streaming + MLlib (one runtime)The fundamental difference from MapReduce: Spark stores raw data and intermediate results in memory with the lazy evaluation pattern and a DAG scheduler. Results are not written to disk unless requested. For iterative workloads like training machine learning models that read a dataset repeatedly, this produces dramatic speedups.
Spark uses the micro-batch model for streaming: incoming data is split into small batches and then processed with exactly the same API as batch processing. That means you write one skill set and use it for both daily ETL and real-time pipelines. This contrasts with other frameworks that force you to learn two different paradigms.
Spark provides concise high-level APIs in Scala, Java, Python, and R. For example, reading CSV, filtering, and aggregating takes just a few lines:
from pyspark.sql import SparkSession
spark = SparkSession.builder.appName("contoh").getOrCreate()
df = spark.read.csv("data/transaksi.csv", header=True)
ringkasan = df.groupBy("kategori").sum("jumlah")
ringkasan.show()df.groupBy("kategori").sum("jumlah") aggregates data across the entire cluster in one line — something that takes dozens of lines in MapReduce. All 23 episodes of this series will build the habit of using this high-level API.
One principle to hold from the start: the higher the level of abstraction you use, the more automatic optimization Spark performs. Start with DataFrames and Spark SQL, then drop down to RDDs only when you truly need low-level control — this is the pattern recommended by almost all data engineering practitioners.
Flink excels at true streaming — processing events one at a time (record-at-a-time) with millisecond latency and very mature state management. Spark uses micro-batches that add tens of milliseconds of latency but are simpler. A rule of thumb: if you need very strict exactly-once semantics and the lowest latency for pure streaming, Flink is a strong candidate; for mixed batch and stream workloads, Spark is more practical.
Beam is an abstraction (SDK + runner), not an engine. You write a pipeline once and run it on various runners: Dataflow, Flink, or Spark. Spark, by contrast, is a complete engine. Beam is useful when an organization wants cross-engine portability; Spark offers feature depth within its own engine.
Spark is used in various industry scenarios:
A real example: a fintech company runs nightly ETL of transactions into a data lake using Spark batch, while the product team analyzes user clicks in real time via Structured Streaming. Both use the same engine and API — this is the value of the unified engine Spark offers.
data sources → ingestion → Spark (batch + stream) → warehouse/lakehouse → BI & MLInfo
The engine choice isn't one-way. Many companies use Spark for batch and ETL, then add Flink specifically for lowest-latency streaming. Understanding these relative strengths makes you a more mature engineer.
Episode 1 gives you the context: Spark was born at the UC Berkeley AMPLab around 2009 to overcome MapReduce's disk-bound weaknesses, became a top-level Apache project in 2014, and is now the most popular distributed engine, with the advantages of in-memory computation and a unified API.
Key takeaways:
In the next episode, episode 2, we'll discuss Spark fundamentals and architecture — the roles of the Driver, Executors, and Cluster Manager, the core RDD/DataFrame/Dataset abstractions, the DAG stages and tasks execution model, and the storage model such as partitioning and shuffle. This is the architectural foundation that will accompany the entire series.