Paper Guides Paper guide

MapReduce: Simplified Data Processing on Large Clusters

Map tasks emit intermediate key/value pairs, and a partition function assigns every pair with the same key to the same reduce task, where the framework groups the values into one list. That grouping is what connects the map and reduce steps.

Reading guide

MapReduce is a batch model in which the user writes two functions and the runtime spreads them over a cluster. The reading question concerns the seam between them. Map output is a stream of key/value pairs, but the framework does not hand that stream to a reducer unchanged. It partitions the pairs by intermediate key, sorts each partition, and groups equal keys, so each reduce call sees one key and all of its values.

Section 2 states the types: map takes (k1, v1) and emits a list of (k2, v2); reduce takes (k2, list(v2)) and emits a list of values. The list(v2) is the connection. Every value sharing k2 arrives in one call, no matter which map task produced it.

Section 3.1 describes execution. A job has M map tasks and R reduce tasks. Each map task buffers output in memory, then writes it to local disk split into R regions using the job's partition function. The master tells each reduce worker where its regions live. The reduce worker reads those regions over the network, sorts by key, and iterates over unique keys. Section 4.1 gives the default partition function, hash(key) mod R. A user can replace it, for example to send all records for one host to the same reducer.

The combiner in Section 4.3 is an optimization on the same path. Before a map task writes its partition, it can run the reduce function locally on each key's values. For word count, a map task that saw the word "the" five times writes ("the", 5) instead of five separate ones. This cuts network traffic. It is valid only when the reduce function is commutative and associative, because the framework may combine in any order and any number of times.

Ordering follows from the same shuffle. Section 4.2 guarantees that, within one partition, intermediate pairs are processed in increasing key order. That is why a MapReduce sort can emit sorted output without a second pass over the data.

Stage Who supplies it What it decides
Map User Turns one input record into zero or more intermediate pairs
Partition User, with a default Which reduce task owns each intermediate key
Sort and group Framework Which values appear together in one reduce call
Reduce User Folds one key's values into output

Word count makes the seam concrete:

def map(key, value):
    for word in value.split():
        emit(word, 1)

def reduce(key, values):
    emit(key, sum(values))

With R = 2, hash(word) mod 2 sends every pair for a given word to one of two reducers. A combiner may collapse the pairs to a partial sum first. The reduce call still receives a list for exactly one word, and the final output has one line per word.

For a different coordination problem, the Raft reading guide explains how a replicated log stays consistent when machines fail.

Evidence and limits

Section 5 evaluates the implementation on a cluster of roughly 1,800 machines, each with two 2 GHz processors, 4 GB of memory, two 160 GB disks, and a gigabit Ethernet link. Two workloads dominate: a grep scanning about one terabyte of 100-byte records and a sort of about one terabyte. The sort exercises the full path, including partitioning, shuffle, and output. Section 5.4 isolates backup tasks, and Section 5.5 injects machine failures.

The population is batch data already stored in a distributed file system, with map tasks scheduled near replicas (Section 3.4). The conclusions therefore describe large, single-pass scans and sorts on a dedicated 2004 cluster, not interactive queries or shared cloud tenancy.

The execution model itself sets the clearest boundary: a job reads input, produces output, and ends, so iterative algorithms must chain jobs and reread intermediate state. Fault handling assumes a single master; if the master fails, this implementation aborts the job and relies on the client to retry (Section 3.3). The combiner and deterministic retries also constrain user code, since arbitrary side effects can be duplicated or reordered. The guide sits in the Computer Science Papers collection with the other paper readings.

Cite the paper

Jeffrey Dean, Sanjay Ghemawat. "MapReduce: Simplified Data Processing on Large Clusters." OSDI 2004.

Open the original paper

BibTeX

@inproceedings{dean2004mapreduce,
  author    = {Jeffrey Dean and Sanjay Ghemawat},
  title     = {{MapReduce: Simplified Data Processing on Large Clusters}},
  booktitle = {Proceedings of the 6th Symposium on Operating Systems Design and Implementation (OSDI 2004)},
  year      = {2004},
  pages     = {137--150},
  publisher = {USENIX Association}
}

Download all paper references (BibTeX)

https://www.fieldnotely.xyz/papers/distributed-systems/mapreduce/

Sources

Revision history

Published
Updated
— Initial publication.