[Bowen picks] how to explain MapReduce to his wife

Source: Internet
Author: User
Tags chop mixed

http://www.csdn.net/article/2011-08-26/303688

absrtact: Indian Java programmer Shekhar Gulati has published how I explained MapReduce to my Wife in his blog, which is a more popular description of the concept of MapReduce. 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 successfully to the technology to listen to ...

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 going?" "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 the topographic map." "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, "you really want to know what MapReduce is." "Yes," she said firmly. So I asked:

me: How do you prepare the 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 it has nothing to do with MapReduce.

me: You 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're doing a map operation. The map operation is suitable for each vegetable, it produces one or more fragments accordingly, in our case the vegetable block is produced. There may be an onion failure in the map operation, you just have to lose the bad onion. So, if a bad onion is present, 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 played in a chili sauce game and your recipe won the best Chili Sauce award. After the award, the chili sauce recipe is popular, so 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 the way it is. Would you be able to finish the production on your own? In other words, the raw materials are chopped up alone. If only a grinding machine can 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 the equivalent of 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 the MapReduce is missing---stirring stage. MapReduce all the output of the vegetables into a broken mix, these 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. That way, you'll 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 people 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 together and add our individual counts. That ' s reduce.

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

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.