# MapReduce Anatomy

A machine\-hall diorama that takes a word\-count MapReduce job apart: split, map, shuffle, reduce, a failing worker and how the idea changed big data

By Numa

Topic: Computing, AI &amp; Electronics

[Open the interactive Jig](https://ask.jig.com/j/17zFxtqHjfnZ)

## Transcript

### 1. Too many words for one computer

Imagine counting every word on billions of web pages\. One computer would take far too long\. In 2004, two Google engineers described MapReduce: a way to share one giant job among thousands of ordinary computers\.

Jeffrey Dean and Sanjay Ghemawat published it in 2004\. Drag anywhere to turn the table\.

### 2. Split the pile

First, the input is cut into pieces called splits\. A coordinator computer, the master, hands each split to a worker computer as a task\. Here, three splits hold short lists of words\.

In the original paper, each split was 16 to 64 megabytes: about as much text as a few dozen long books\.

### 3. Map: a card for every word

Each worker runs the map step on its own split, all at the same time\. For every word it reads, it writes a little card saying the word and the number 1\. Each colour here is one word: cat, dog or fish\.

These cards are called key\-value pairs\. The word is the key\. They wait on the worker's own disk\.

### 4. Shuffle: sort by word

Now the cards travel\. Every card for the same word goes to the same reducer, a computer that will combine them, so cat cards meet cat cards\. Press Shuffle to send them\.

The programmer never writes this step\. The system moves and sorts the cards by itself\.

### 5. Reduce: add them up

Each reducer combines all the cards for its word\. For counting words, that means adding up the ones\. The stacks show the answer: cat 4, dog 3, fish 2\.

Reduce can combine in other ways too, like keeping the biggest value\.

### 6. When a computer breaks

With thousands of cheap computers, some break in the middle of a job\. The master notices a silent worker and gives its task to a spare machine, and the job still finishes\. Press Unplug to try it\.

In August 2004, Google saw about 1\.2 worker failures per job on average\. Slow workers get backup copies too\.

### 7. Three computers or thousands

The same pattern works with three computers or thousands\. Programmers wrote just two small functions, map and reduce\. The system did the splitting, scheduling, sorting and repairs\.

In August 2004 alone, Google ran 29,423 MapReduce jobs, using about 157 machines per job on average\.

### 8. How it changed big data

In 2006, Hadoop brought the same idea to everyone as free software\. Companies could crunch huge piles of data on racks of ordinary computers\. Newer tools such as Spark keep map and reduce, but go faster by keeping data in memory instead of writing it to disk at every step\.

Google moved on to newer systems by 2014, but MapReduce's ideas are everywhere\.
