Where We Are. Review: Parallel DBMS. Parallel DBMS. Introduction to Data Management CSE 344

Similar documents
Introduction to Data Management CSE 344

Introduction to Data Management CSE 344

CSE 544 Principles of Database Management Systems. Alvin Cheung Fall 2015 Lecture 10 Parallel Programming Models: Map Reduce and Spark

Introduction to Data Management CSE 344

Database Systems CSE 414

Announcements. Optional Reading. Distributed File System (DFS) MapReduce Process. MapReduce. Database Systems CSE 414. HW5 is due tomorrow 11pm

Announcements. Parallel Data Processing in the 20 th Century. Parallel Join Illustration. Introduction to Database Systems CSE 414

CSE 344 MAY 2 ND MAP/REDUCE

CSE 544 Principles of Database Management Systems. Magdalena Balazinska Winter 2015 Lecture 11 Parallel DBMSs and MapReduce

Parallel Programming Principle and Practice. Lecture 10 Big Data Processing with MapReduce

Distributed Computations MapReduce. adapted from Jeff Dean s slides

MapReduce: Simplified Data Processing on Large Clusters

MapReduce Spark. Some slides are adapted from those of Jeff Dean and Matei Zaharia

Introduction to Data Management CSE 344

Database Management Systems CSEP 544. Lecture 6: Query Execution and Optimization Parallel Data processing

Parallel Nested Loops

Parallel Partition-Based. Parallel Nested Loops. Median. More Join Thoughts. Parallel Office Tools 9/15/2011

Big Data Management and NoSQL Databases

Introduction to Data Management CSE 344

CS 61C: Great Ideas in Computer Architecture. MapReduce

MI-PDB, MIE-PDB: Advanced Database Systems

What We Have Already Learned. DBMS Deployment: Local. Where We Are Headed Next. DBMS Deployment: 3 Tiers. DBMS Deployment: Client/Server

Introduction to Database Systems CSE 414

The MapReduce Abstraction

The MapReduce Framework

Parallel Computing: MapReduce Jin, Hai

CS555: Distributed Systems [Fall 2017] Dept. Of Computer Science, Colorado State University

Database System Architectures Parallel DBs, MapReduce, ColumnStores

CompSci 516: Database Systems

Why compute in parallel?

Announcements. Reading Material. Map Reduce. The Map-Reduce Framework 10/3/17. Big Data. CompSci 516: Database Systems

L22: SC Report, Map Reduce

Large-Scale GPU programming

Practice and Applications of Data Management CMPSCI 345. Lecture 18: Big Data, Hadoop, and MapReduce

MapReduce. Kiril Valev LMU Kiril Valev (LMU) MapReduce / 35

Cloud Programming. Programming Environment Oct 29, 2015 Osamu Tatebe

Part A: MapReduce. Introduction Model Implementation issues

CSE 414: Section 7 Parallel Databases. November 8th, 2018

MapReduce, Hadoop and Spark. Bompotas Agorakis

Parallel Programming Concepts

Introduction to Map Reduce

CS6030 Cloud Computing. Acknowledgements. Today s Topics. Intro to Cloud Computing 10/20/15. Ajay Gupta, WMU-CS. WiSe Lab

Scaling Up 1 CSE 6242 / CX Duen Horng (Polo) Chau Georgia Tech. Hadoop, Pig

Data Clustering on the Parallel Hadoop MapReduce Model. Dimitrios Verraros

Database Applications (15-415)

Announcements. Database Systems CSE 414. Why compute in parallel? Big Data 10/11/2017. Two Kinds of Parallel Data Processing

Systems Infrastructure for Data Science. Web Science Group Uni Freiburg WS 2013/14

MapReduce: Recap. Juliana Freire & Cláudio Silva. Some slides borrowed from Jimmy Lin, Jeff Ullman, Jerome Simeon, and Jure Leskovec

Outline. MapReduce Data Model. MapReduce. Step 2: the REDUCE Phase. Step 1: the MAP Phase 11/29/11. Introduction to Data Management CSE 344

Lecture 11 Hadoop & Spark

MapReduce & Resilient Distributed Datasets. Yiqing Hua, Mengqi(Mandy) Xia

Introduction to MapReduce. Adapted from Jimmy Lin (U. Maryland, USA)

6.830 Lecture Spark 11/15/2017

Advanced Data Management Technologies

Clustering Lecture 8: MapReduce

Big Data Programming: an Introduction. Spring 2015, X. Zhang Fordham Univ.

Databases 2 (VU) ( / )

Principles of Data Management. Lecture #16 (MapReduce & DFS for Big Data)

Page 1. Goals for Today" Background of Cloud Computing" Sources Driving Big Data" CS162 Operating Systems and Systems Programming Lecture 24

MapReduce-II. September 2013 Alberto Abelló & Oscar Romero 1

Introduction to MapReduce

In the news. Request- Level Parallelism (RLP) Agenda 10/7/11

1. Introduction to MapReduce

Distributed Systems. 18. MapReduce. Paul Krzyzanowski. Rutgers University. Fall 2015

"Big Data" Open Source Systems. CS347: Map-Reduce & Pig. Motivation for Map-Reduce. Building Text Index - Part II. Building Text Index - Part I

Map Reduce Group Meeting

Batch Processing Basic architecture

Hadoop/MapReduce Computing Paradigm

Cloud Computing CS

MapReduce. Simplified Data Processing on Large Clusters (Without the Agonizing Pain) Presented by Aaron Nathan

Distributed Computation Models

HDFS: Hadoop Distributed File System. CIS 612 Sunnie Chung

Programming Models MapReduce

MapReduce and Hadoop

Big Data Hadoop Stack

Google: A Computer Scientist s Playground

Google: A Computer Scientist s Playground

Systems Infrastructure for Data Science. Web Science Group Uni Freiburg WS 2012/13

Scalable Web Programming. CS193S - Jan Jannink - 2/25/10

MapReduce: Simplified Data Processing on Large Clusters 유연일민철기

CS 345A Data Mining. MapReduce

Survey Paper on Traditional Hadoop and Pipelined Map Reduce

Overview. Why MapReduce? What is MapReduce? The Hadoop Distributed File System Cloudera, Inc.

Hadoop Map Reduce 10/17/2018 1

PLATFORM AND SOFTWARE AS A SERVICE THE MAPREDUCE PROGRAMMING MODEL AND IMPLEMENTATIONS

Distributed computing: index building and use

Agenda. Request- Level Parallelism. Agenda. Anatomy of a Web Search. Google Query- Serving Architecture 9/20/10

Distributed Systems CS6421

Map Reduce. Yerevan.

MapReduce and Friends

Map-Reduce. Marco Mura 2010 March, 31th

MapReduce. Stony Brook University CSE545, Fall 2016

ECE5610/CSC6220 Introduction to Parallel and Distribution Computing. Lecture 6: MapReduce in Parallel Computing

Advanced Database Technologies NoSQL: Not only SQL

Topics. Big Data Analytics What is and Why Hadoop? Comparison to other technologies Hadoop architecture Hadoop ecosystem Hadoop usage examples

Introduction to MapReduce

CS /5/18. Paul Krzyzanowski 1. Credit. Distributed Systems 18. MapReduce. Simplest environment for parallel processing. Background.

MapReduce: A Programming Model for Large-Scale Distributed Computation

MapReduce-style data processing

The amount of data increases every day Some numbers ( 2012):

Transcription:

Where We Are Introduction to Data Management CSE 344 Lecture 22: MapReduce We are talking about parallel query processing There exist two main types of engines: Parallel DBMSs (last lecture + quick review) MapReduce and similar systems (this lecture) 1 2 Review: Parallel DBMS SQL Query Parallel DBMS Parallel query plan: tree of parallel operators Data streams from one operator to the next Typically all cluster nodes process all operators Can run multiple queries at the same time Queries will share the nodes in the cluster From: Greenplum Database Whitepaper 3 Notice that user does not need to know how his/her SQL query was processed 4 Loading Data into a Parallel DBMS Example using Teradata System Example Parallel Query Execution Find all orders from today, along with the items ordered SELECT * FROM Orders o, Lines i WHERE o.item = i.item AND o.date = today() join o.item = i.item date = today() AMP = unit of parallelism 5 6 1

Example Parallel Query Execution join o.item = i.item date = today() Example Parallel Query Execution join o.item = i.item date = today() h(o.item) date=today() h(o.item) date=today() h(o.item) date=today() h(i.item) h(i.item) h(i.item) 7 8 Example Parallel Query Execution join join join o.item = i.item o.item = i.item o.item = i.item contains all orders and all lines where (item) = 2 contains all orders and all lines where (item) = 1 contains all orders and all lines where (item) = 3 9 Parallel Dataflow Implementation Use relational operators unchanged Add a special shuffle operator Handle data routing, buffering, and flow control Inserted between consecutive operators in the query plan Two components: ShuffleProducer and ShuffleConsumer Producer pulls data from operator and sends to n consumers Producer acts as driver for operators below it in query plan Consumer buffers input data from n producers and makes it available to operator through getnext interface 10 Data Centers Today Parallel Data Processing at Massive Scale Large number of commodity servers, connected by high speed, commodity network Rack: holds a small number of servers Data center: holds many racks 11 READING ASSIGNMENT: Map-reduce (Section 20.2); Chapter 2 (Sections 1,2,3 only) of Mining of Massive Datasets, by Rajaraman and Ullman See the course Calendar Magda Balazinska Website - CSE 344, Fall 2012 12 2

Data Processing at Massive Scale Want to process petabytes of data and more Massive parallelism: 100s, or 1000s, or 10000s servers Many hours Failure: If medium-time-between-failure is 1 year Then 10000 servers have one failure / hour 13 Distributed File System (DFS) For very large files: TBs, PBs Each file is partitioned into chunks, typically 64MB Each chunk is replicated several times ( 3), on different racks, for fault tolerance Implementations: Google s DFS: GFS, proprietary Hadoop s DFS: HDFS, open source 14 MapReduce Observation: Your favorite parallel algorithm Google: paper published 2004 Free variant: Hadoop MapReduce = high-level programming model and implementation for large-scale parallel data processing Reduce (Shuffle) Map 15 16 Typical Problems Solved by MR Read a lot of data Map: extract something you care about from each record Shuffle and Sort Reduce: aggregate, summarize, filter, transform Write the results Outline stays the same, map and reduce change to fit the problem Files! Data Model A file = a bag of (key, value) pairs A MapReduce program: Input: a bag of (inputkey, value)pairs Output: a bag of (outputkey, value)pairs 17 slide source: Jeff Dean 18 3

Step 1: the MAP Phase User provides the MAP-function: Input: (input key, value) Ouput: bag of (intermediate key, value) System applies the map function in parallel to all (input key, value) pairs in the input file Step 2: the REDUCE Phase User provides the REDUCE function: Input: (intermediate key, bag of values) Output: bag of output (values) System groups all pairs with the same intermediate key, and passes the bag of values to the REDUCE function 19 20 Example MAP REDUCE Counting the number of occurrences of each word in a large collection of documents Each Document The key = document id (did) The value = set of words (word) map(string key, String value): // key: document name // value: document contents for each word w in value: EmitIntermediate(w, 1 ); reduce(string key, Iterator values): // key: a word // values: a list of counts int result = 0; for each v in values: result += ParseInt(v); 21 Emit(AsString(result)); (did1,v1) (did2,v2) (did3,v3).... (w3,1) Shuffle (w1, (1,1,1,,1)) (w2, (1,1,)) (w3,(1)) (w1, 25) (w2, 77) (w3, 12) 22 Jobs v.s. Tasks A MapReduce Job One single query, e.g. count the words in all docs More complex queries may consists of multiple jobs A Map Task, or a Reduce Task A group of instantiations of the map-, or reducefunction, which are scheduled on a single worker Workers A worker is a process that executes one task at a time Typically there is one worker per processor, hence 4 or 8 per node 23 24 4

(did1,v1) (did2,v2) (did3,v3).... MAP Tasks (w3,1) Shuffle REDUCE Tasks (w1, (1,1,1,,1)) (w1, 25) (w2, (1,1,)) (w2, 77) (w3,(1)) (w3, 12) Reduce (Shuffle) Map MapReduce Execution Details Task Task Output to disk, replicated in cluster Intermediate data goes to local disk Data not necessarily local File system: GFS or HDFS 26 MR Phases Each Map and Reduce task has multiple phases: Slot ID Map Example: CloudBurst Shuffle Sort Reduce Local storage ` CloudBurst. Lake Washington Dataset (1.1GB). 80 Mappers 80 Reducers. Time 27 28 Implementation There is one master node Master partitions input file into M splits, by key Master assigns workers (=servers) to the M map tasks, keeps track of their progress Workers write their output to local disk, partition into R regions Master assigns workers to the R reduce tasks Reduce workers read regions from the map workers local disks Interesting Implementation Details Worker failure: Master pings workers periodically, If down then reassigns the task to another worker 29 30 5

Interesting Implementation Details Backup tasks: Straggler = a machine that takes unusually long time to complete one of the last tasks. Eg: Bad disk forces frequent correctable errors (30MB/s à 1MB/s) The cluster scheduler has scheduled other tasks on that machine Stragglers are a main reason for slowdown Solution: pre-emptive backup execution of the last few remaining in-progress tasks MapReduce Summary Hides scheduling and parallelization details However, very limited queries Difficult to write more complex queries Need multiple MapReduce jobs Solution: declarative query language 31 32 Declarative Languages on MR Parallel DBMS vs MapReduce PIG Latin (Yahoo!) New language, like Relational Algebra Open source HiveQL (Facebook) SQL-like language Open source SQL / Tenzing (Google) SQL on MR Proprietary Parallel DBMS Relational data model and schema Declarative query language: SQL Many pre-defined operators: relational algebra Can easily combine operators into complex queries Query optimization, indexing, and physical tuning Streams data from one operator to the next without blocking Can do more than just run queries: Data management Updates and transactions, constraints, security, etc. 33 34 Parallel DBMS vs MapReduce HW6 MapReduce Data model is a file with key-value pairs! No need to load data before processing it Easy to write user-defined operators Can easily add nodes to the cluster (no need to even restart) Uses less memory since processes one key-group at a time Intra-query fault-tolerance thanks to results on disk Intermediate results on disk also facilitate scheduling Handles adverse conditions: e.g., stragglers Arguably more scalable but also needs more nodes! We will use MapReduce (Hadoop) We will use a declarative language: Pig Latin Cluster will run in Amazon s cloud Give your credit card Click, click, click and you have a MapReduce cluster running all configured for you We will analyze a real 0.5TB graph 35 36 6