Q15Big Data Analytics
Question
4 marks
Compare Spark processing with Hadoop MapReduce.
Answer
A definitive architectural contrast between Apache Spark and Hadoop MapReduce. Violently details the catastrophic disk I/O bottleneck of MapReduce against Spark's explosive in-memory RDD architecture and Directed Acyclic Graph (DAG) execution.
Hadoop MapReduce invented the Big Data industry, but it is mathematically obsolete for modern iterative processing. Apache Spark was engineered from the ground up to completely annihilate the physical Disk I/O bottlenecks that crippled MapReduce, resulting in processing speeds up to 100x faster.
- MapReduce (Disk-Bound): MapReduce is mathematically paranoid about hardware failure. After the Map phase finishes, it violently writes every single byte of intermediate data back to the physical Hard Drive. The Reduce phase then reads it back from the Hard Drive. If an algorithm requires 10 iterations (like Machine Learning), it executes 10 catastrophic write/read cycles to slow, spinning disks.
- Spark (In-Memory): Spark utilizes Resilient Distributed Datasets (RDDs). It mathematically forces the intermediate data to stay locked entirely in physical RAM across the cluster. It never touches the hard drive unless explicitly commanded. This completely destroys the latency bottleneck.
- MapReduce (Rigid Sequence): It is forced into a strict two-step box: Map, then Reduce. You cannot mathematically change this pipeline.
- Spark (DAG Scheduler): Spark builds a highly complex Directed Acyclic Graph (DAG) of operations before it executes anything. It mathematically analyzes the entire pipeline, optimizes the query, and pipelines multiple operations (Map, Filter, Reduce) into a single, seamless, memory-bound execution stage.
- MapReduce: Strictly handles Batch processing. It physically cannot handle real-time streaming data.
- Spark: The absolute unified engine. The exact same Spark cluster can execute massive SQL queries, train Machine Learning models (MLlib), analyze Graph architectures (GraphX), and process sub-second real-time streams (Spark Streaming) using the exact same underlying RAM architecture.