Docsity

Google's MapReduce: A Distributed Data Processing System, Slides of Parallel Computing and Programming

Partial preview of the text

Download Google's MapReduce: A Distributed Data Processing System and more Slides Parallel Computing and Programming in PDF only on Docsity!

Data Analysis with MapReduce

3

Motivation: Large Scale Data Processing

  • Want to process many terabytes of raw data —documents found by a web crawl —web request logs
  • Produce various kinds of derived data —inverted indices - e.g. mapping from words to locations in documents —various representations of graph structure of documents —summaries of number of pages crawled per host —most frequent queries in a given day —...

5

Desiderata

  • Automatic parallelization & distribution of computation
  • Fault tolerance
  • Clean and simple programming abstraction —programming for the masses ...
  • Monitoring and status tools —monitor computation progress —adjust resource provisioning, if necessary

6

Solution: MapReduce Programming Model

  • Inspired by^ map^ and^ reduce^ primitives in Lisp —mapping a function f over a sequence x y z yields f(x) f(y) f(z) —reduce function combines sequence elements using a binary op
  • Many data analysis computations can be expressed as —applying a map operation to each logical input record - produce a set of intermediate (key, value) pairs —applying a reduce to all intermediate pairs with same key
  • Simple programming model using an^ application framework —user supplies map and reduce operators —messy implementation details handled by the framework - parallelization - fault tolerance - data distribution - load balance

Applying the Framework

  • Fill in a^ MapReduce^ specification^ object with —names of input and output files —map and reduce operators —optional tuning parameters
  • Invoke the^ MapReduce^ framework to initiate the computation —pass the specification object as an argument 8

Benefits of the MapReduce Framework

  • Functional model —simple and powerful interface —automatic parallelization and distribution of computations —enables re-execution for fault tolerance
  • Implementation achieves high performance 9

MapReduce Examples - I

  • Distributed “grep” (pattern search) —map: emits a line if it matches a supplied pattern —reduce: identity function - copies intermediate data to the output
  • Count of URL access frequency —map: processes logs of web page requests, outputs a sequence of <URL, 1> tuples —reduce: adds together all values for the same URL and emits a <URL, total count> pair
  • Reverse web-link graph —map: outputs <target, source> pairs for each link to a target URL found in a page named source —reduce: concatenates the list of all source URLs associated with a given target URL - emits the pair: <target, list of sources> 11

MapReduce Examples - II

  • Term-vector per host —map: emits a <hostname, term vector> pair for each input document - hostname is extracted from the URL of the document —reduce: passed all per-document term vectors for a given host - adds term vectors together - throws away infrequent terms, emits a <hostname, term vector> pair
  • Inverted Index —map: parses each document, emits a sequence of <word, document ID> pairs —reduce: accepts all pairs for a given word, sorts the corresponding document IDs, emits a <word, list(document IDs)> 12 —set of all output pairs forms a simple inverted index —easy to augment this to keep track of word positions summarize the most important words that occur in a document or a set of documents as a list of <word, frequency> pairs

Implementation Considerations

  • Many different implementations are possible
  • Right choice depends on environment, e.g. —small shared memory machine —large NUMA multiprocessor —larger collection of networked machines
  • Google environment (2004) —dual-processor x86, Linux, 2-4GB memory —commodity network: 100Mb/1Gb Ethernet per machine - much less than full bisection bandwidth —thousands of machines: failure common —storage: - inexpensive disks attached directly to machines - distributed file system to manage data on these disks replication provides availability and reliability on unreliable h/w 14

Execution Overview

15

Logical Overview of Execution

17

Logical Execution

Figure credit: http://labs.google.com/papers/mapreduce-osdi04-slides/index-auto-0007.html 18

Execution Timeline

  • Many more tasks than machines
  • Pipeline data movement with map execution 20 Figure credit: http://labs.google.com/papers/mapreduce-osdi04-slides/index-auto-0009.html

Fault Tolerance: Worker Failure

  • Detecting failure —master pings worker periodically —if no answer after a while, master marks worker as failed
  • Coping with failure —any map tasks for worker reset to idle state; may be rescheduled —worker’s completed map tasks re-execute on failure - data on local disk of failed worker is inaccessible - any reducers attempting to read notified of the re-execution 21 Fault tolerance example: —network maintenance on a cluster caused groups of 80 machines at a time to become unreachable for several minutes —master simply re-executed work for unreachable machines and continued to make forward progress