### re: Explain MapReduce like I'm five VIEW POST

Santa needs some help with organizing his christmas presents. He has a stack of presents, each of which contains one or more toys. The toys can be dolls, model trains or Speak 'n Spells. For his bookkeeping, Santa needs to know how many of each kind of toy he's giving away. He knows he should have told the elves to keep count of the toys while packing the presents, but he totally forgot.

So now, all the presents need to be opened, toys inside the presents need to be counted, and tallied up so he knows the total number of each toy he's giving to kids. In order to make this as efficient as possible, he divides his elves into groups.

First, there's the Mapper elves. They'll each get a bunch of presents, and open them. For each type of toy in a present, the elf will write the type, and the number of toys of that type in the present, on a slip of paper.

Let's have a look at Franky, he's one of the mappers. He's just opened a box containing a speak 'n spell, and 2 dolls. He puts 2 slips of paper in a box:

Speak 'n spell: 1

Doll: 2

Then, there's a group of elves called the Shufflers. They shuffle pieces of paper around, into neat stacks. Each stack has all the paper slips corresponding to a certain toy type.

Then, there's the Reducer elves. They reduce the amount of paper that Santa has to look through to get the results he needs. Each elf takes a stack of paper, and counts up all the numbers. Then, they put a paper with the toy type they tallied up, and the total number, on Santa's desk.

code of conduct - report abuse