Spark / RDDs

MapReduce was good but required more complexity for multi-stage application (lacks efficient primitives for data sharing) and interactive ad-hoc queries.

The challenge is to design a distributed memory abstraction that is fault tolerant AND efficient.

1. Resilient Distributed Datasets

RDDs store data lineage instead of data (can be used for recovery). They are partitioned across nodes, immutable, only allow coarse-grained operations (e.g. map, filter, reduceByKey), and are lazily evaluated.

These can unify many programming models (e.g. MapReduce, iterative algorithms, graph processing, streaming).

2. Lineage Graph

The lineage of RDDs is represented as a DAG. Each RDD has a narrow or wide dependency on its parent RDDs:

Fault tolerance is achieved by recomputing lost partitions using the lineage graph. This is more efficient than replication, but may be slower for wide dependencies. Spark also allows manual checkpointing of RDDs to avoid long lineage chains.

Back to Home