← Back to examples

MapReduce, step by step: Word Count

The "hello world" of big data. Type a sentence, then step through the four phases — Split → Map → Shuffle & Sort → Reduce. You write only map and reduce; the framework does the rest.

0 · Input
1 · Split
2 · Map
3 · Shuffle & Sort
4 · Reduce

Split (mappers)

Map → (word, 1)

Shuffle: group by key

Reduce: sum

Press Next step to begin. Each phase runs in parallel across the cluster.

Why this is the whole idea: Map tags every word with a 1 — it never counts, so mappers never need to talk to each other (perfectly parallel). The framework's shuffle gathers all the 1s for each word together. Reduce just sums them. The exact same two functions work on one sentence or on ten petabytes across 5,000 machines — map is data parallelism, reduce is the reduction.