DEV Community

Discussion on: Explain MapReduce like I'm five

Collapse
 
rhymes profile image
rhymes

For a five year old: you have to count how many lego pieces you have in your 5 boxes so you give each of your 4 friends one box and you count the last one.

After a few days, aided by their own parents, they come back to you with a piece of paper with the number of legos in the box (hopefully they didn't keep the box :D):

  • Alice has 120 lego pieces
  • Bob has 65 lego pieces
  • Carla has 99 lego pieces
  • Dany has 87 lego pieces
  • Ben has 77 lego pieces

You ask your parents, because you're five and you don't know how to sum all those numbers, and they tell you that the total of lego pieces you have is 448

Map: "Friend: count all the pieces in your box"
Reduce: "Sum all the counts of all friends"

MapReduce at scale :D