SlideShare a Scribd company logo
1 of 39
MapReduce: Simplified Data
Processing on Large Clusters
Jeffrey Dean &
Sanjay Ghemawat
Appeared in:
OSDI '04: Sixth Symposium on Operating System Design and Implementation, San Francisco, CA, December,
2004.
Presented by: Hemanth Makkapati (makka@vt.edu)
Mom told Sam
An apple a day keeps a doctor away!
One day
Sam thought of “drinking” the apple
So, he used a to cut
the and a to
make juice.
Next Day
Sam applied his invention to all the fruits
he could find in the fruit basket
Simple!!!
18 Years Later
Sam got his first job with juice making giants,
Joogle, for his talent in making juice
• Now, it’s not just one basket but
a whole container of fruits
• Also, he has to make juice of
different fruits separately
• And, Sam has just ONE and
ONE
But!
Simple???
Is this representative of
computations that process
large-scale data?
Why?
• The operations themselves are conceptually
simple
– Making juice
– Indexing
– Recommendations etc
• But, the data to process is HUGE!!!
– Google processes over 20 PB of data every day
• Sequential execution just won’t scale up
Why?
• Parallel execution achieves greater
efficiency
• But, parallel programming is hard
– Parallelization
• Race Conditions
• Debugging
– Fault Tolerance
– Data Distribution
– Load Balancing
MapReduce
• “MapReduce is a programming model and an associated
implementation for processing and generating large data
sets”
• Programming model
– Abstractions to express simple computations
• Library
– Takes care of the gory stuff: Parallelization,
Fault Tolerance, Data Distribution and Load
Balancing
Programming Model
• To generate a set of output key-value pairs from a set of
input key-value pairs
– { < ki, vi >}  { < ko, vo >}
• Expressed using two abstractions:
– Map task
• <ki, vi>  { < kint, vint > }
– Reduce task
• < kint, {vint} >  < ko, vo >
• Library
– aggregates all the all intermediate values associated with the
same intermediate key
– passes the intermediate key-value pairs to reduce function
Inspiration
• ‘map’ & ‘reduce/fold’ of functional programming
languages
• (map f list [list2 list3 …])
– (map square (1 2 3 4))  (1 4 9 16)
• (reduce f list […])
– (reduce + (1 4 9 16))  30
• (reduce + (map square (map – l1 l2))))
Example
Map Reduce
Example: Word Count
map(String input_key, String input_value):
// input_key: document name
// input_value: document contents
for each word w in input_value:
EmitIntermediate(w, "1");
reduce(String output_key, Iterator intermediate_values):
// output_key: a word
// output_values: a list of counts
int result = 0;
for each v in intermediate_values:
result += ParseInt(v);
Emit(AsString(result));
<“Sam”, “1”>, <“Apple”, “1”>, <“Sam”, “1”>,
<“Mom”, “1”>, <“Sam”, “1”>, <“Mom”, “1”>,
<“Sam” , [“1”,”1”,”1”]>, <“Apple” , [“1”]>,
<“Mom” , [“1”, “1”]>
“3”
“1”
“2”
Implementation
• Large cluster of commodity PCs
– Connected together with switched Ethernet
– X86 dual-processor, 2-4 GB memory each
– Linux OS
– Storage by GFS on IDE disks
• Scheduling system
– Users submit jobs
– Tasks are scheduled to available machines on
cluster
Google File System (GFS)
• File is divided into several chunks of
predetermined size
– Typically, 16-64 MB
• Replicates each chunk by a predetermined
factor
– Usually, three replicas
• Replication to achieve fault-tolerance
– Availability
– Reliability
GFS Architecture
Execution
• User specifies
– M: no. of map tasks
– R: no. of reduce tasks
• Map Phase
– input is partitioned into M splits
– map tasks are distributed across multiple machines
• Reduce Phase
– reduce tasks are distributed across multiple machines
– intermediate keys are partitioned (using partitioning
function) to be processed by desired reduce task
Execution Flow
Sam & MapReduce
Sam implemented a parallel version of his innovation
Master Data Structures
• For each task
– State { idle, in-progress, completed }
– Identity of the worker machine
• For each completed map task
– Size and location of intermediate data
Fault Tolerance
• Worker failure – handled via re-execution
– Identified by no response to heartbeat messages
– In-progress and Completed map tasks are re-
scheduled
– Workers executing reduce tasks are notified of re-
scheduling
– Completed reduce tasks are not re-scheduled
• Master failure
– Rare
– Can be recovered from checkpoints
– All tasks abort
Disk Locality
• Leveraging GFS
• Map tasks are scheduled close to data
– on nodes that have input data
– if not, on nodes that are nearer to input data
• Ex. Same network switch
• Conserves network bandwidth
Task Granularity
• No. of map tasks > no. of worker nodes
– Better load balancing
– Better recovery
• But, increases load on Master
– More scheduling decisions
– More states to be saved
• M could be chosen w.r.t to block size of the file
system
– to effectively leverage locality
• R is usually specified by users
– Each reduce task produces one output file
Stragglers
• Slow workers delay completion time
– Bad disks with soft errors
– Other tasks eating up resources
– Strange reasons like processor cache being
disabled
• Start back-up tasks as the job nears
completion
– First task to complete is considered
Refinement: Partitioning Function
• Identifies the desired reduce task
– Given the intermediate key and R
• Default partitioning function
– hash(key) mod R
• Important to choose well-balanced
partitioning functions
– If not, reduce tasks may delay completion time
Refinement: Combiner Function
• Mini-reduce phase before the intermediate
data is sent to reduce
• Significant repetition of intermediate keys
possible
– Merge values of intermediate keys before
sending to reduce tasks
• Similar to reduce function
• Saves network bandwidth
Refinement: Skipping Bad Records
• Map/Reduce tasks may fail on certain records
due to bugs
– Ideally, debug and fix
– Not possible if third-party code is buggy
• When worker dies, Master is notified of the
record
• If more than one worker dies on the same
record
– Master re-schedules the task and asks to skip the
record
Refinements: others
• Ordering guarantees
– sorted output file
• Temporary files
• Local sequential execution
– to debug and test
• Status Information
– input, intermediate & output bytes processed so far
– error & failure reports
• Counters
– to keep track of specific events
Performance
• Evaluated on two programs running on a large
cluster & processing 1 TB data
– grep & sort
• Cluster Configuration
– 1800 machines
• 2 GHz Intel Xeon processors
• 4 GB memory
• two 160 GB IDE disks
• gigabit Ethernet link
– Hosted in the same facility
Grep
• Scans for a three character pattern
• M = 15000 @ 64 MB per split
• R = 1
• Entire computation takes 150s
• Startup overhead apprx. 60s
– Propagation of programs to worker machines
– GFS operations
– Information of locality optimizations
Sort
• Models TeraSort benchmark
• M = 15000 @ 64 MB per split
• R = 4000
• Workers = 1700
• Evaluated on three executions
– with backup tasks
– without backup tasks
– with machine failures
Sort
Normal execution Without backup tasks With machine failures
Experience: Google Indexing System
• Complete re-write using MapReduce
• Modeled as a sequence of multiple
MapReduce operations
• Much simpler code
– fewer LoC
– shorter code changes
– easier to improve performance
Conclusion
• Easy to use scalable programming model for
large-scale data processing on clusters
– Allows users to focus on computations
• Hides issues of
– parallelization, fault tolerance, data partitioning
& load balancing
• Achieves efficiency through disk-locality
• Achieves fault-tolerance through replication
New Trend: Disk-locality Irrelevant
• Assumes disk bandwidth exceeds network
bandwidth
• Network speeds fast improving
• Disk speeds have stagnated
• Next step: attain memory-locality
Hadoop
• An open-source framework for data-
intensive distributed applications
• Inspired from Google’s MapReduce & GFS
• Implemented in Java
• Name after the toy elephant of creator’s son
Hadoop History
• Nutch, an effort to develop open-souce
search engine
• Soon, encountered scalability issues to
store and process large data sets
• Google published MapReduce and GFS
• Attempted re-creation for Nutch
• Yahoo! got interested and contributed
Hadoop Ecosystem
• Hadoop MapReduce
– inspired by Google’s MapReduce
• Hadoop Distributed File System(HDFS)
– inspired by Google File System
• HBase – Hadoop Database
– inspired by Google BigTable
• Cassandra – Distributed Key-Value Store
– Inspired by Amazon Dynamo & Google BigTable
References
• Google File System
– http://labs.google.com/papers/gfs.html
• Google BigTable
– http://labs.google.com/papers/bigtable.html
• Apache Hadoop
– http://hadoop.apache.org/
• Juice Example
– http://esaliya.blogspot.com/2010/03/mapredu
ce-explained-simply-as-story-of.html
Thank you

More Related Content

Similar to MapReduce.pptx

Spark Overview and Performance Issues
Spark Overview and Performance IssuesSpark Overview and Performance Issues
Spark Overview and Performance IssuesAntonios Katsarakis
 
Hadoop and Mapreduce for .NET User Group
Hadoop and Mapreduce for .NET User GroupHadoop and Mapreduce for .NET User Group
Hadoop and Mapreduce for .NET User GroupCsaba Toth
 
(Berkeley CS186 guest lecture) Big Data Analytics Systems: What Goes Around C...
(Berkeley CS186 guest lecture) Big Data Analytics Systems: What Goes Around C...(Berkeley CS186 guest lecture) Big Data Analytics Systems: What Goes Around C...
(Berkeley CS186 guest lecture) Big Data Analytics Systems: What Goes Around C...Reynold Xin
 
Map reduce - simplified data processing on large clusters
Map reduce - simplified data processing on large clustersMap reduce - simplified data processing on large clusters
Map reduce - simplified data processing on large clustersCleverence Kombe
 
MapReduce:Simplified Data Processing on Large Cluster Presented by Areej Qas...
MapReduce:Simplified Data Processing on Large Cluster  Presented by Areej Qas...MapReduce:Simplified Data Processing on Large Cluster  Presented by Areej Qas...
MapReduce:Simplified Data Processing on Large Cluster Presented by Areej Qas...areej qasrawi
 
Hadoop performance optimization tips
Hadoop performance optimization tipsHadoop performance optimization tips
Hadoop performance optimization tipsSubhas Kumar Ghosh
 
Hadoop first mr job - inverted index construction
Hadoop first mr job - inverted index constructionHadoop first mr job - inverted index construction
Hadoop first mr job - inverted index constructionSubhas Kumar Ghosh
 
L19CloudMapReduce introduction for cloud computing .ppt
L19CloudMapReduce introduction for cloud computing .pptL19CloudMapReduce introduction for cloud computing .ppt
L19CloudMapReduce introduction for cloud computing .pptMaruthiPrasad96
 
Introduction to map reduce
Introduction to map reduceIntroduction to map reduce
Introduction to map reduceM Baddar
 
Introduction To Map Reduce
Introduction To Map ReduceIntroduction To Map Reduce
Introduction To Map Reducerantav
 
11. From Hadoop to Spark 1:2
11. From Hadoop to Spark 1:211. From Hadoop to Spark 1:2
11. From Hadoop to Spark 1:2Fabio Fumarola
 
Putting Lipstick on Apache Pig at Netflix
Putting Lipstick on Apache Pig at NetflixPutting Lipstick on Apache Pig at Netflix
Putting Lipstick on Apache Pig at NetflixJeff Magnusson
 
Netflix - Pig with Lipstick by Jeff Magnusson
Netflix - Pig with Lipstick by Jeff Magnusson Netflix - Pig with Lipstick by Jeff Magnusson
Netflix - Pig with Lipstick by Jeff Magnusson Hakka Labs
 
Big Data Analytics Chapter3-6@2021.pdf
Big Data Analytics Chapter3-6@2021.pdfBig Data Analytics Chapter3-6@2021.pdf
Big Data Analytics Chapter3-6@2021.pdfWasyihunSema2
 

Similar to MapReduce.pptx (20)

Spark Overview and Performance Issues
Spark Overview and Performance IssuesSpark Overview and Performance Issues
Spark Overview and Performance Issues
 
Hadoop and Mapreduce for .NET User Group
Hadoop and Mapreduce for .NET User GroupHadoop and Mapreduce for .NET User Group
Hadoop and Mapreduce for .NET User Group
 
(Berkeley CS186 guest lecture) Big Data Analytics Systems: What Goes Around C...
(Berkeley CS186 guest lecture) Big Data Analytics Systems: What Goes Around C...(Berkeley CS186 guest lecture) Big Data Analytics Systems: What Goes Around C...
(Berkeley CS186 guest lecture) Big Data Analytics Systems: What Goes Around C...
 
Map reduce - simplified data processing on large clusters
Map reduce - simplified data processing on large clustersMap reduce - simplified data processing on large clusters
Map reduce - simplified data processing on large clusters
 
Map reduce
Map reduceMap reduce
Map reduce
 
MapReduce:Simplified Data Processing on Large Cluster Presented by Areej Qas...
MapReduce:Simplified Data Processing on Large Cluster  Presented by Areej Qas...MapReduce:Simplified Data Processing on Large Cluster  Presented by Areej Qas...
MapReduce:Simplified Data Processing on Large Cluster Presented by Areej Qas...
 
MapReduce
MapReduceMapReduce
MapReduce
 
MapReduce basics
MapReduce basicsMapReduce basics
MapReduce basics
 
Hadoop performance optimization tips
Hadoop performance optimization tipsHadoop performance optimization tips
Hadoop performance optimization tips
 
Hadoop first mr job - inverted index construction
Hadoop first mr job - inverted index constructionHadoop first mr job - inverted index construction
Hadoop first mr job - inverted index construction
 
L19CloudMapReduce introduction for cloud computing .ppt
L19CloudMapReduce introduction for cloud computing .pptL19CloudMapReduce introduction for cloud computing .ppt
L19CloudMapReduce introduction for cloud computing .ppt
 
Hadoop
HadoopHadoop
Hadoop
 
Introduction to map reduce
Introduction to map reduceIntroduction to map reduce
Introduction to map reduce
 
Introduction To Map Reduce
Introduction To Map ReduceIntroduction To Map Reduce
Introduction To Map Reduce
 
Enar short course
Enar short courseEnar short course
Enar short course
 
11. From Hadoop to Spark 1:2
11. From Hadoop to Spark 1:211. From Hadoop to Spark 1:2
11. From Hadoop to Spark 1:2
 
Lipstick On Pig
Lipstick On Pig Lipstick On Pig
Lipstick On Pig
 
Putting Lipstick on Apache Pig at Netflix
Putting Lipstick on Apache Pig at NetflixPutting Lipstick on Apache Pig at Netflix
Putting Lipstick on Apache Pig at Netflix
 
Netflix - Pig with Lipstick by Jeff Magnusson
Netflix - Pig with Lipstick by Jeff Magnusson Netflix - Pig with Lipstick by Jeff Magnusson
Netflix - Pig with Lipstick by Jeff Magnusson
 
Big Data Analytics Chapter3-6@2021.pdf
Big Data Analytics Chapter3-6@2021.pdfBig Data Analytics Chapter3-6@2021.pdf
Big Data Analytics Chapter3-6@2021.pdf
 

Recently uploaded

9654467111 Call Girls In Munirka Hotel And Home Service
9654467111 Call Girls In Munirka Hotel And Home Service9654467111 Call Girls In Munirka Hotel And Home Service
9654467111 Call Girls In Munirka Hotel And Home ServiceSapana Sha
 
Call Girls In Mahipalpur O9654467111 Escorts Service
Call Girls In Mahipalpur O9654467111  Escorts ServiceCall Girls In Mahipalpur O9654467111  Escorts Service
Call Girls In Mahipalpur O9654467111 Escorts ServiceSapana Sha
 
RadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdfRadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdfgstagge
 
GA4 Without Cookies [Measure Camp AMS]
GA4 Without Cookies [Measure Camp AMS]GA4 Without Cookies [Measure Camp AMS]
GA4 Without Cookies [Measure Camp AMS]📊 Markus Baersch
 
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...Sapana Sha
 
RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998YohFuh
 
04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationshipsccctableauusergroup
 
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /WhatsappsBeautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsappssapnasaifi408
 
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样vhwb25kk
 
办理(Vancouver毕业证书)加拿大温哥华岛大学毕业证成绩单原版一比一
办理(Vancouver毕业证书)加拿大温哥华岛大学毕业证成绩单原版一比一办理(Vancouver毕业证书)加拿大温哥华岛大学毕业证成绩单原版一比一
办理(Vancouver毕业证书)加拿大温哥华岛大学毕业证成绩单原版一比一F La
 
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Callshivangimorya083
 
PKS-TGC-1084-630 - Stage 1 Proposal.pptx
PKS-TGC-1084-630 - Stage 1 Proposal.pptxPKS-TGC-1084-630 - Stage 1 Proposal.pptx
PKS-TGC-1084-630 - Stage 1 Proposal.pptxPramod Kumar Srivastava
 
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
Data Science Jobs and Salaries Analysis.pptx
Data Science Jobs and Salaries Analysis.pptxData Science Jobs and Salaries Analysis.pptx
Data Science Jobs and Salaries Analysis.pptxFurkanTasci3
 
Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...
Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...
Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...Jack DiGiovanna
 
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改atducpo
 
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...Suhani Kapoor
 
DBA Basics: Getting Started with Performance Tuning.pdf
DBA Basics: Getting Started with Performance Tuning.pdfDBA Basics: Getting Started with Performance Tuning.pdf
DBA Basics: Getting Started with Performance Tuning.pdfJohn Sterrett
 

Recently uploaded (20)

9654467111 Call Girls In Munirka Hotel And Home Service
9654467111 Call Girls In Munirka Hotel And Home Service9654467111 Call Girls In Munirka Hotel And Home Service
9654467111 Call Girls In Munirka Hotel And Home Service
 
Call Girls In Mahipalpur O9654467111 Escorts Service
Call Girls In Mahipalpur O9654467111  Escorts ServiceCall Girls In Mahipalpur O9654467111  Escorts Service
Call Girls In Mahipalpur O9654467111 Escorts Service
 
RadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdfRadioAdProWritingCinderellabyButleri.pdf
RadioAdProWritingCinderellabyButleri.pdf
 
Call Girls in Saket 99530🔝 56974 Escort Service
Call Girls in Saket 99530🔝 56974 Escort ServiceCall Girls in Saket 99530🔝 56974 Escort Service
Call Girls in Saket 99530🔝 56974 Escort Service
 
GA4 Without Cookies [Measure Camp AMS]
GA4 Without Cookies [Measure Camp AMS]GA4 Without Cookies [Measure Camp AMS]
GA4 Without Cookies [Measure Camp AMS]
 
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
 
RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998
 
04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships
 
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /WhatsappsBeautiful Sapna Vip  Call Girls Hauz Khas 9711199012 Call /Whatsapps
Beautiful Sapna Vip Call Girls Hauz Khas 9711199012 Call /Whatsapps
 
Deep Generative Learning for All - The Gen AI Hype (Spring 2024)
Deep Generative Learning for All - The Gen AI Hype (Spring 2024)Deep Generative Learning for All - The Gen AI Hype (Spring 2024)
Deep Generative Learning for All - The Gen AI Hype (Spring 2024)
 
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样
 
办理(Vancouver毕业证书)加拿大温哥华岛大学毕业证成绩单原版一比一
办理(Vancouver毕业证书)加拿大温哥华岛大学毕业证成绩单原版一比一办理(Vancouver毕业证书)加拿大温哥华岛大学毕业证成绩单原版一比一
办理(Vancouver毕业证书)加拿大温哥华岛大学毕业证成绩单原版一比一
 
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
 
PKS-TGC-1084-630 - Stage 1 Proposal.pptx
PKS-TGC-1084-630 - Stage 1 Proposal.pptxPKS-TGC-1084-630 - Stage 1 Proposal.pptx
PKS-TGC-1084-630 - Stage 1 Proposal.pptx
 
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
 
Data Science Jobs and Salaries Analysis.pptx
Data Science Jobs and Salaries Analysis.pptxData Science Jobs and Salaries Analysis.pptx
Data Science Jobs and Salaries Analysis.pptx
 
Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...
Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...
Building on a FAIRly Strong Foundation to Connect Academic Research to Transl...
 
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
 
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
 
DBA Basics: Getting Started with Performance Tuning.pdf
DBA Basics: Getting Started with Performance Tuning.pdfDBA Basics: Getting Started with Performance Tuning.pdf
DBA Basics: Getting Started with Performance Tuning.pdf
 

MapReduce.pptx

  • 1. MapReduce: Simplified Data Processing on Large Clusters Jeffrey Dean & Sanjay Ghemawat Appeared in: OSDI '04: Sixth Symposium on Operating System Design and Implementation, San Francisco, CA, December, 2004. Presented by: Hemanth Makkapati (makka@vt.edu)
  • 2. Mom told Sam An apple a day keeps a doctor away!
  • 3. One day Sam thought of “drinking” the apple So, he used a to cut the and a to make juice.
  • 4. Next Day Sam applied his invention to all the fruits he could find in the fruit basket Simple!!!
  • 5. 18 Years Later Sam got his first job with juice making giants, Joogle, for his talent in making juice • Now, it’s not just one basket but a whole container of fruits • Also, he has to make juice of different fruits separately • And, Sam has just ONE and ONE But! Simple??? Is this representative of computations that process large-scale data?
  • 6. Why? • The operations themselves are conceptually simple – Making juice – Indexing – Recommendations etc • But, the data to process is HUGE!!! – Google processes over 20 PB of data every day • Sequential execution just won’t scale up
  • 7. Why? • Parallel execution achieves greater efficiency • But, parallel programming is hard – Parallelization • Race Conditions • Debugging – Fault Tolerance – Data Distribution – Load Balancing
  • 8. MapReduce • “MapReduce is a programming model and an associated implementation for processing and generating large data sets” • Programming model – Abstractions to express simple computations • Library – Takes care of the gory stuff: Parallelization, Fault Tolerance, Data Distribution and Load Balancing
  • 9. Programming Model • To generate a set of output key-value pairs from a set of input key-value pairs – { < ki, vi >}  { < ko, vo >} • Expressed using two abstractions: – Map task • <ki, vi>  { < kint, vint > } – Reduce task • < kint, {vint} >  < ko, vo > • Library – aggregates all the all intermediate values associated with the same intermediate key – passes the intermediate key-value pairs to reduce function
  • 10. Inspiration • ‘map’ & ‘reduce/fold’ of functional programming languages • (map f list [list2 list3 …]) – (map square (1 2 3 4))  (1 4 9 16) • (reduce f list […]) – (reduce + (1 4 9 16))  30 • (reduce + (map square (map – l1 l2))))
  • 12. Example: Word Count map(String input_key, String input_value): // input_key: document name // input_value: document contents for each word w in input_value: EmitIntermediate(w, "1"); reduce(String output_key, Iterator intermediate_values): // output_key: a word // output_values: a list of counts int result = 0; for each v in intermediate_values: result += ParseInt(v); Emit(AsString(result)); <“Sam”, “1”>, <“Apple”, “1”>, <“Sam”, “1”>, <“Mom”, “1”>, <“Sam”, “1”>, <“Mom”, “1”>, <“Sam” , [“1”,”1”,”1”]>, <“Apple” , [“1”]>, <“Mom” , [“1”, “1”]> “3” “1” “2”
  • 13. Implementation • Large cluster of commodity PCs – Connected together with switched Ethernet – X86 dual-processor, 2-4 GB memory each – Linux OS – Storage by GFS on IDE disks • Scheduling system – Users submit jobs – Tasks are scheduled to available machines on cluster
  • 14. Google File System (GFS) • File is divided into several chunks of predetermined size – Typically, 16-64 MB • Replicates each chunk by a predetermined factor – Usually, three replicas • Replication to achieve fault-tolerance – Availability – Reliability
  • 16. Execution • User specifies – M: no. of map tasks – R: no. of reduce tasks • Map Phase – input is partitioned into M splits – map tasks are distributed across multiple machines • Reduce Phase – reduce tasks are distributed across multiple machines – intermediate keys are partitioned (using partitioning function) to be processed by desired reduce task
  • 18. Sam & MapReduce Sam implemented a parallel version of his innovation
  • 19. Master Data Structures • For each task – State { idle, in-progress, completed } – Identity of the worker machine • For each completed map task – Size and location of intermediate data
  • 20. Fault Tolerance • Worker failure – handled via re-execution – Identified by no response to heartbeat messages – In-progress and Completed map tasks are re- scheduled – Workers executing reduce tasks are notified of re- scheduling – Completed reduce tasks are not re-scheduled • Master failure – Rare – Can be recovered from checkpoints – All tasks abort
  • 21. Disk Locality • Leveraging GFS • Map tasks are scheduled close to data – on nodes that have input data – if not, on nodes that are nearer to input data • Ex. Same network switch • Conserves network bandwidth
  • 22. Task Granularity • No. of map tasks > no. of worker nodes – Better load balancing – Better recovery • But, increases load on Master – More scheduling decisions – More states to be saved • M could be chosen w.r.t to block size of the file system – to effectively leverage locality • R is usually specified by users – Each reduce task produces one output file
  • 23. Stragglers • Slow workers delay completion time – Bad disks with soft errors – Other tasks eating up resources – Strange reasons like processor cache being disabled • Start back-up tasks as the job nears completion – First task to complete is considered
  • 24. Refinement: Partitioning Function • Identifies the desired reduce task – Given the intermediate key and R • Default partitioning function – hash(key) mod R • Important to choose well-balanced partitioning functions – If not, reduce tasks may delay completion time
  • 25. Refinement: Combiner Function • Mini-reduce phase before the intermediate data is sent to reduce • Significant repetition of intermediate keys possible – Merge values of intermediate keys before sending to reduce tasks • Similar to reduce function • Saves network bandwidth
  • 26. Refinement: Skipping Bad Records • Map/Reduce tasks may fail on certain records due to bugs – Ideally, debug and fix – Not possible if third-party code is buggy • When worker dies, Master is notified of the record • If more than one worker dies on the same record – Master re-schedules the task and asks to skip the record
  • 27. Refinements: others • Ordering guarantees – sorted output file • Temporary files • Local sequential execution – to debug and test • Status Information – input, intermediate & output bytes processed so far – error & failure reports • Counters – to keep track of specific events
  • 28. Performance • Evaluated on two programs running on a large cluster & processing 1 TB data – grep & sort • Cluster Configuration – 1800 machines • 2 GHz Intel Xeon processors • 4 GB memory • two 160 GB IDE disks • gigabit Ethernet link – Hosted in the same facility
  • 29. Grep • Scans for a three character pattern • M = 15000 @ 64 MB per split • R = 1 • Entire computation takes 150s • Startup overhead apprx. 60s – Propagation of programs to worker machines – GFS operations – Information of locality optimizations
  • 30. Sort • Models TeraSort benchmark • M = 15000 @ 64 MB per split • R = 4000 • Workers = 1700 • Evaluated on three executions – with backup tasks – without backup tasks – with machine failures
  • 31. Sort Normal execution Without backup tasks With machine failures
  • 32. Experience: Google Indexing System • Complete re-write using MapReduce • Modeled as a sequence of multiple MapReduce operations • Much simpler code – fewer LoC – shorter code changes – easier to improve performance
  • 33. Conclusion • Easy to use scalable programming model for large-scale data processing on clusters – Allows users to focus on computations • Hides issues of – parallelization, fault tolerance, data partitioning & load balancing • Achieves efficiency through disk-locality • Achieves fault-tolerance through replication
  • 34. New Trend: Disk-locality Irrelevant • Assumes disk bandwidth exceeds network bandwidth • Network speeds fast improving • Disk speeds have stagnated • Next step: attain memory-locality
  • 35. Hadoop • An open-source framework for data- intensive distributed applications • Inspired from Google’s MapReduce & GFS • Implemented in Java • Name after the toy elephant of creator’s son
  • 36. Hadoop History • Nutch, an effort to develop open-souce search engine • Soon, encountered scalability issues to store and process large data sets • Google published MapReduce and GFS • Attempted re-creation for Nutch • Yahoo! got interested and contributed
  • 37. Hadoop Ecosystem • Hadoop MapReduce – inspired by Google’s MapReduce • Hadoop Distributed File System(HDFS) – inspired by Google File System • HBase – Hadoop Database – inspired by Google BigTable • Cassandra – Distributed Key-Value Store – Inspired by Amazon Dynamo & Google BigTable
  • 38. References • Google File System – http://labs.google.com/papers/gfs.html • Google BigTable – http://labs.google.com/papers/bigtable.html • Apache Hadoop – http://hadoop.apache.org/ • Juice Example – http://esaliya.blogspot.com/2010/03/mapredu ce-explained-simply-as-story-of.html

Editor's Notes

  1. Greeting Myself Today’s topic Authors Conference MapReduce aims to provide a simplified approach to program and run distributed applications Analogy
  2. Compared to eating apple, drinking juice is fun
  3. Excited by his success at making apple juice, Sam now wants to make juice from multiple fruits He excelled at this for sometime and then
  4. Like with any giant, be it search giants or juice making giants, you are going to have huge numbers at hand Like search, recommendations, usage analysis, page rank etc?
  5. This complicates the computation that we want to perform! So, MapReduce proposes a way to separate computation from managing distributed-ness
  6. Managing of Parallelization, Fault Tolerance, Data Distribution and Load Balancing is invisible to the user and comes free Motivation: primarily meant for Google’s web indexing Once the documents are crawled Several mapreduce operations are run in sequence to index documents
  7. Abstract: Take something ustructured and derive meaningful data out of it
  8. Functional languages: logic is expressed as expressions No mutable data and state. computed values cannot be dependent on previously computed values. ( X -> Y -> Z ) Order does not matter
  9. 1. The MapReduce library in the user program first splits the input les into M pieces of typically 16 megabytes to 64 megabytes (MB) per piece (controllable by the user via an optional parameter). It then starts up many copies of the program on a cluster of machines. 2. One of the copies of the program is special . the master. The rest are workers that are assigned work by the master. There are M map tasks and R reduce tasks to assign. The master picks idle workers and assigns each one a map task or a reduce task. 3. A worker who is assigned a map task reads the contents of the corresponding input split. It parses key/value pairs out of the input data and passes each pair to the user-defined Map function. The intermediate key/value pairs produced by the Map function are buffered in memory. 4. Periodically, the buffered pairs are written to local disk, partitioned into R regions by the partitioning function. The locations of these buffered pairs on the local disk are passed back to the master, who is responsible for forwarding these locations to the reduce workers. 5. When a reduce worker is notified by the master about these locations, it uses remote procedure calls to read the buffered data from the local disks of the map workers. When a reduce worker has read all intermediate data, it sorts it by the intermediate keys so that all occurrences of the same key are grouped together. The sorting is needed because typically many different keys map to the same reduce task. If the amount of intermediate data is too large to t in memory, an external sort is used. 6. The reduce worker iterates over the sorted intermediate data and for each unique intermediate key encountered, it passes the key and the corresponding set of intermediate values to the user's Reduce function. The output of the Reduce function is appended to a final output file for this reduce partition. 7. When all map tasks and reduce tasks have been completed, the master wakes up the user program. At this point, the MapReduce call in the user program returns back to the user code.
  10. Sometimes a secondary Master is employed