beginnerbig-data

Introduction to Apache Spark

Like MapReduce, but it keeps data in memory instead of writing to disk between every step.

Key Points

What it is

Apache Spark is a distributed data processing engine that processes large datasets across a cluster, keeping intermediate data in memory rather than writing it to disk between steps like MapReduce did — making it dramatically faster, especially for iterative and interactive workloads.

Why it exists

MapReduce's habit of writing results to disk between every step made it painfully slow for jobs that needed multiple passes over the same data — like most iterative machine learning algorithms. Spark exists to keep data in memory across steps whenever possible, delivering major speed gains, especially for workloads that reuse the same data repeatedly.

Intuition

MapReduce is like a chef who, after every single step of a recipe, writes the current state down on paper, files it away, then re-reads it before the next step. Spark is a chef who just keeps the half-finished dish on the counter, ready for the next step immediately — far faster, as long as there's enough 'counter space' (memory) to do it.

When to use

When not to use

Common mistakes

In practice

The industry-standard engine for large-scale data processing and feature engineering pipelines, often used to prepare data at scale before feeding it into machine learning models, either within Spark's own MLlib or exported for use elsewhere.

Was this concept helpful?

Spot an error or gap? Suggest an edit →

Related concepts

spark-rddspark-dataframesspark-transformations-actionsmapreduce
Chirp at me!