[Bowen picks] how to explain MapReduce to his wife

Source: Internet
Author: User
Keywords onions chili sauce vegetables
Tags blog distributed computing get how to java listeners office online

Shekhar Gulati, an Indian Java programmer, has published "How I explained MapReduce to my Wife" on his blog. The concept of MapReduce is described in a more popular way. As follows, the translator is the Huanghui Oracle online.

Yesterday, I delivered a speech about MapReduce in the Xebia India Office. The speech went well and the listeners were able to understand the MapReduce (based on their feedback). I was thrilled to have successfully explained the concept of MapReduce to technical listeners (mainly Java programmers, some flex programmers, and a handful of testers). After all the hard work, we had a big dinner at the Xebia India Office, and then I went straight home.

When I got home, my wife asked, "How's Your Supriya?" "I said it was good. Then she asked me what the meeting was about (she was not working in the field of software or programming). I told her that it was mapreduce. "Mapduce, what is that thing?" She asked, "Is it related to topographic maps?" "I said no, no, it has nothing to do with topographic maps." "Well, what the heck is it?" The wife asked. "Well ... Let's go to Dominos (pizza chain) and I'll explain it to you at the table. The wife said: OK. "And then we went to the pizza parlor.

After we ordered the domions, the guy at the counter told us that the pizza would take 15 minutes to get ready. So I asked my wife, "Do you really want to know what MapReduce is?" "Yes," she said firmly. So I asked:

Me: How do you prepare onion chili sauce? (The following is not an accurate recipe, please do not try at home)

Wife: I'll take an onion, chop it up, then mix in the salt and water, and finally put it in the mixer grinder. This will get the onion chili sauce. But what does this have to do with MapReduce?

Me: Wait a minute. Let me make a complete plot so that you can understand mapreduce in 15 minutes.

Wife: All right.

Me: Now, suppose you want to make a bottle of mixed chili sauce with mint, onion, tomato, chili and garlic. What would you do?

Wife: I will take a pinch of peppermint leaves, one onion, one tomato, one chili, one garlic, chopped and chopped into the right amount of salt and water, then put into the mixer grinding machine, so you can get a bottle of mixed chili sauce.

Me: Yes, let's apply the concept of mapreduce to recipes. Map and reduce are actually two kinds of operations, I'll give you a detailed explanation.

Map (map): Chopping onions, tomatoes, peppers and garlic is a map operation that acts on these objects. So if you give the map an onion, map will chop the onion. Similarly, if you bring chili, garlic and tomatoes to map one by one, you will get all kinds of fragments. So when you're cutting vegetables like onions, you perform a map operation. The map operation is suitable for each vegetable, it produces one or more fragments accordingly, in our case we produce vegetable blocks. There may be an onion failure in the map operation, you just have to lose the bad onion. So if a bad onion appears, the map operation will filter out the bad onions without producing any bad onion blocks.

Reduce (Simplify): At this stage, you can get a bottle of chili sauce by grinding all the pieces of vegetables into the grinder. This means making a bottle of chili sauce and you have to grind all the ingredients. As a result, the mill usually gathers the chopped vegetables in the map operation.

Wife: So, this is MapReduce?

Me: You can say yes, or you can say no. In fact, this is only part of the MapReduce, MapReduce is the powerful in distributed computing.

Wife: Distributed computing? What is that? Please explain it to me.

Me: no problem.

Let's say you took a chili jam game and your recipe won the best Chili Sauce award. After the award, the chili sauce recipe is so popular that you want to start selling homemade chili sauce. What would you do if you needed to produce 10000 bottles of chili sauce a day?

Wife: I'll find a supplier who can provide me with a lot of raw materials.

Me: Yes ... That's it. Can you make it on your own? In other words, cutting the raw materials alone? can only one grinder meet the needs? And now, we also need to supply different kinds of chili sauce, such as onion chili sauce, pepper pepper sauce, tomato chili sauce and so on.

Wife: Of course not, I will hire more workers to cut vegetables. I need more grinding machines so I can make chili sauce faster.

Me: Yes, so now you have to assign a job, you will need a few people to cut vegetables together. Everyone has to deal with a bag full of vegetables, and everyone is equivalent to performing a simple map operation. Each person will continue to take out the vegetables from the bag, and each time only a vegetable processing, that is, they chopped until the bag empty.

In this way, when all the workers are cut off, the work station (where everyone works) has onion chunks, tomato blocks, and garlic and so on.

Wife: But how can I make different kinds of ketchup?

Me: Now you will see that the stage of mapreduce---agitation. MapReduce all the output of the vegetables into a broken mix, the vegetables are broken in the key based on the map operation. Stirring will be done automatically, you can assume that key is the name of a raw material, just like an onion. So all of the onion keys are stirred together and transferred to the grinding onion grinder. So you get the onion chili sauce. In the same way, all tomatoes are also transferred to the grinding device labeled tomatoes and produce tomato chili sauce.

The pizza was finally ready, and she nodded that she had understood what MapReduce was. I just hope that the next time she hears MapReduce, she'll understand better what I'm doing.

Bole Blog Note: The following passage is the other people on the Internet in the shortest language to explain MapReduce:

We want to count all of the books in the library. Count up Shelf #1 and I count up shelf #2. That ' s map. The more arranges we get, the faster it goes.

We want to count all the books in the library. Number 1th, I'll count Bookshelf 2nd. This is "Map". The more we are, the quicker we can count the books.

Now we have up and add our individual counts. That ' s reduce.

Now we come together and add all the statistics together. This is "Reduce".

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.