Introduction to Data Management CSE 344

Similar documents
Introduction to Database Systems CSE 414

Introduction to Data Management CSE 344

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

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

Introduction to Data Management CSE 344

CSE 344 MAY 2 ND MAP/REDUCE

Introduction to Data Management CSE 344

Introduction to Database Systems CSE 414. Lecture 16: Query Evaluation

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

CSE 544: Principles of Database Systems

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

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

Introduction to Data Management CSE 344

Why compute in parallel?

CompSci 516: Database Systems. Lecture 20. Parallel DBMS. Instructor: Sudeepa Roy

Parallel DBMS. Lecture 20. Reading Material. Instructor: Sudeepa Roy. Reading Material. Parallel vs. Distributed DBMS. Parallel DBMS 11/15/18

Parallel DBMS. Lecture 20. Reading Material. Instructor: Sudeepa Roy. Reading Material. Parallel vs. Distributed DBMS. Parallel DBMS 11/7/17

Hadoop vs. Parallel Databases. Juliana Freire!

Outline. Parallel Database Systems. Information explosion. Parallelism in DBMSs. Relational DBMS parallelism. Relational DBMSs.

Parallel DBMS. Parallel Database Systems. PDBS vs Distributed DBS. Types of Parallelism. Goals and Metrics Speedup. Types of Parallelism

CMU SCS CMU SCS Who: What: When: Where: Why: CMU SCS

COURSE 12. Parallel DBMS

Systems Infrastructure for Data Science. Web Science Group Uni Freiburg WS 2014/15

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

Data Management in the Cloud: Limitations and Opportunities. Daniel Abadi Yale University January 30 th, 2009

Database Systems CSE 414

Parallel DBMS. Prof. Yanlei Diao. University of Massachusetts Amherst. Slides Courtesy of R. Ramakrishnan and J. Gehrke

CSE6331: Cloud Computing

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

Huge market -- essentially all high performance databases work this way

CSE 544, Winter 2009, Final Examination 11 March 2009

Parallel Nested Loops

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

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

CSE 344 Final Review. August 16 th

Optimization Overview

Crescando: Predictable Performance for Unpredictable Workloads

VOLTDB + HP VERTICA. page

MapReduce. Stony Brook University CSE545, Fall 2016

What is Data Warehouse like

Advanced Databases: Parallel Databases A.Poulovassilis

Chapter 18: Database System Architectures.! Centralized Systems! Client--Server Systems! Parallel Systems! Distributed Systems!

Introduction to Data Management CSE 344

Big Data Analytics. Izabela Moise, Evangelos Pournaras, Dirk Helbing

Database System Architectures Parallel DBs, MapReduce, ColumnStores

Lecture 23 Database System Architectures

Hadoop/MapReduce Computing Paradigm

Parallel DBMS. Chapter 22, Part A

Chapter 20: Database System Architectures

SAP HANA. Jake Klein/ SVP SAP HANA June, 2013

Big Data Technology Ecosystem. Mark Burnette Pentaho Director Sales Engineering, Hitachi Vantara

Architecture and Implementation of Database Systems (Winter 2014/15)

PARALLEL & DISTRIBUTED DATABASES CS561-SPRING 2012 WPI, MOHAMED ELTABAKH

Data-Intensive Distributed Computing

Cloud Computing 2. CSCI 4850/5850 High-Performance Computing Spring 2018

Lecture 24: Parallel Databases. Wednesday, November 24, 2010

data parallelism Chris Olston Yahoo! Research

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

Parallel DBs. April 23, 2018

Advanced Database Systems

Chapter 18 Strategies for Query Processing. We focus this discussion w.r.t RDBMS, however, they are applicable to OODBS.

Announcements. From SQL to RA. Query Evaluation Steps. An Equivalent Expression

CSE 344 MAY 7 TH EXAM REVIEW

Announcement. Reading Material. Overview of Query Evaluation. Overview of Query Evaluation. Overview of Query Evaluation 9/26/17

How to survive the Data Deluge: Petabyte scale Cloud Computing

Your New App. Motivation. Data Management is Universal. Staff. Introduction to Data Management (Database Systems) CSE 414. Lecture 1: Introduction

Tutorial Outline. Map/Reduce vs. DBMS. MR vs. DBMS [DeWitt and Stonebraker 2008] Acknowledgements. MR is a step backwards in database access

Introduction to Data Management (Database Systems) CSE 414

CS-460 Database Management Systems

CSE 190D Spring 2017 Final Exam Answers

Part I What are Databases?

In-Memory Data Management

OS and Hardware Tuning

CIS 601 Graduate Seminar. Dr. Sunnie S. Chung Dhruv Patel ( ) Kalpesh Sharma ( )

Data Partitioning and MapReduce

Database Management Systems

OS and HW Tuning Considerations!

Morsel- Drive Parallelism: A NUMA- Aware Query Evaluation Framework for the Many- Core Age. Presented by Dennis Grishin

Shark: Hive (SQL) on Spark

Greenplum Architecture Class Outline

Data Intensive Scalable Computing. Thanks to: Randal E. Bryant Carnegie Mellon University

Database Architecture 2 & Storage. Instructor: Matei Zaharia cs245.stanford.edu

! Parallel machines are becoming quite common and affordable. ! Databases are growing increasingly large

Chapter 20: Parallel Databases

Chapter 20: Parallel Databases. Introduction

Database Architectures

Before we talk about Big Data. Lets talk about not-so-big data

R & G Chapter 13. Implementation of single Relational Operations Choices depend on indexes, memory, stats, Joins Blocked nested loops:

CSE 344 JULY 30 TH DB DESIGN (CH 4)

Accelerating Analytical Workloads

Chapter 17: Parallel Databases

Chapter 18: Parallel Databases

CSE 190D Spring 2017 Final Exam

Chapter 18: Parallel Databases

Chapter 18: Parallel Databases. Chapter 18: Parallel Databases. Parallelism in Databases. Introduction

HadoopDB: An Architectural Hybrid of MapReduce and DBMS Technologies for Analytical Workloads

Safe Harbor Statement

SAP HANA Scalability. SAP HANA Development Team

Introduction to Data Management CSE 344. Lectures 9: Relational Algebra (part 2) and Query Evaluation

CSC 261/461 Database Systems Lecture 19

Transcription:

Introduction to Data Management CSE 344 Lectures 23 and 24 Parallel Databases 1

Why compute in parallel? Most processors have multiple cores Can run multiple jobs simultaneously Natural extension of txn processing Nice to get computation results earlier J 2

Cloud computing Cloud computing commoditizes access to large clusters Ten years ago, only Google could afford 1000 servers; Today you can rent this from Amazon Web Services (AWS) Cheap! 3

Science is Facing a Data Deluge! Astronomy: Large Synoptic Survey Telescope LSST: 30TB/night (high-resolution, high-frequency sky surveys) Physics: Large Hadron Collider 25PB/year Biology: lab automation, high-throughput sequencing Oceanography: high-resolution models, cheap sensors, satellites Medicine: ubiquitous digital records, MRI, ultrasound 4

Industry is Facing a Data Deluge! Clickstreams, search logs, network logs, social networking data, RFID data, etc. Facebook: 15PB of data in 2010 60TB of new data every day Google: In May 2010 processed 946PB of data using MapReduce Twitter, Google, Microsoft, Amazon, Walmart, etc. 5

Big Data Companies, organizations, scientists have data that is too big, too fast, and too complex to be managed without changing tools and processes Relational algebra and SQL are easy to parallelize and parallel DBMSs have already been studied in the 80's! 6

Data Analytics Companies As a result, we are seeing an explosion of and a huge success of db analytics companies Greenplum founded in 2003 acquired by EMC in 2010; A parallel shared-nothing DBMS (this lecture) Vertica founded in 2005 and acquired by HP in 2011; A parallel, column-store shared-nothing DBMS (see 444 for discussion of column-stores) DATAllegro founded in 2003 acquired by Microsoft in 2008; A parallel, shared-nothing DBMS Aster Data Systems founded in 2005 acquired by Teradata in 2011; A parallel, shared-nothing, MapReduce-based data processing system (next lecture). SQL on top of MapReduce Netezza founded in 2000 and acquired by IBM in 2010. A parallel, shared-nothing DBMS. Great time to be in the data management, CSE 344 data - Fall 2015 mining/statistics, or machine learning! 7

Two Kinds to Parallel Data Processing Parallel databases, developed starting with the 80s (this lecture) OLTP (Online Transaction Processing) OLAP (Online Analytic Processing, or Decision Support) MapReduce, first developed by Google, published in 2004 (next lecture) Mostly for Decision Support Queries Today we see convergence of the MapReduce and Parallel DB approaches 8

Performance Metrics for Parallel DBMSs P = the number of nodes (processors, computers) Speedup: More nodes, same data è higher speed Scaleup: More nodes, more data è same speed OLTP: Speed = transactions per second (TPS) Decision Support: Speed = query time 9

Linear v.s. Non-linear Speedup Speedup 1 5 10 15 # nodes (=P) 10

Linear v.s. Non-linear Scaleup Batch Scaleup Ideal 1 5 10 15 # nodes (=P) AND data size 11

Challenges to Linear Speedup and Scaleup Startup cost Cost of starting an operation on many nodes Interference Contention for resources between nodes Skew Slowest node becomes the bottleneck 12

Architectures for Parallel Shared memory Databases Shared disk Shared nothing 13

Shared Memory P P P Interconnection Network Global Shared Memory D D D 14

Shared Disk M M M P P P Interconnection Network D D D 15

Shared Nothing Interconnection Network P P P M M M D D D 16

A Professional Picture From: Greenplum Database Whitepaper SAN = Storage Area Network 17

Shared Memory Nodes share both RAM and disk Dozens to hundreds of processors Example: SQL Server runs on a single machine and can leverage many threads to get a query to run faster (see query plans) Easy to use and program But very expensive to scale: last remaining cash cows in the hardware industry 18

Shared Disk All nodes access the same disks Found in the largest "single-box" (noncluster) multiprocessors Oracle dominates this class of systems. Characteristics: Also hard to scale past a certain point: existing deployments typically have fewer than 10 machines 19

Shared Nothing Cluster of machines on high-speed network Called "clusters" or "blade servers Each machine has its own memory and disk: lowest contention. NOTE: Because all machines today have many cores and many disks, then shared-nothing systems typically run many "nodes on a single physical machine. Characteristics: Today, this is the most scalable architecture. Most difficult to administer and tune. We discuss only Shared Nothing in class 20

Approaches to Parallel Query Evaluation Inter-query parallelism Transaction per node OLTP Product pid=pid cid=cid Purchase pid=pid cid=cid Customer Product Product Purchase pid=pid cid=cid Customer Purchase Customer Inter-operator parallelism Operator per node Both OLTP and Decision Support Intra-operator parallelism Operator on multiple nodes Decision Support Product cid=cid pid=pid Customer Purchase cid=cid pid=pid Customer Product Purchase We study only intra-operator CSE 344 - Fall parallelism: 2015 most scalable 21

Parallel DBMS Parallel query plan: tree of parallel operators Intra-operator parallelism Data streams from one operator to the next Typically all cluster nodes process all operators Can run multiple queries at the same time Inter-query parallelism Queries will share the nodes in the cluster Notice that user does not need to know how his/her SQL query was processed 22

Basic Query Processing: Quick Review in Class Basic query processing on one node. Given relations R(A,B) and S(B, C), no indexes, how do we compute: Selection: σ A=123 (R) Scan file R, select records with A=123 Group-by: γ A,sum(B) (R) Scan file R, insert into a hash table using attr. A as key When a new key is equal to an existing one, add B to the value Join: R S Scan file S, insert into a hash table using attr. B as key Scan file R, probe the hash table using attr. B 23

Parallel Query Processing How do we compute these operations on a shared-nothing parallel db? Selection: σ A=123 (R) (that s easy, won t discuss ) Group-by: γ A,sum(B) (R) Join: R S Before we answer that: how do we store R (and S) on a shared-nothing parallel db? 24

Horizontal Data Partitioning Data: Servers: K A B 1 2... P 25

Horizontal Data Partitioning Data: Servers: K A B 1 2... P K A B K A B K A B Which tuples go to what server? 26

Horizontal Data Partitioning Block Partition: Partition tuples arbitrarily s.t. size(r 1 ) size(r P ) Hash partitioned on attribute A: Tuple t goes to chunk i, where i = h(t.a) mod P + 1 Range partitioned on attribute A: Partition the range of A into - = v 0 < v 1 < < v P = Tuple t goes to chunk i, if v i-1 < t.a < v i 27

Parallel GroupBy Data: R(K,A,B,C) Query: γ A,sum(C) (R) Discuss in class how to compute in each case: R is hash-partitioned on A R is block-partitioned R is hash-partitioned on K 28

Parallel GroupBy Data: R(K,A,B,C) Query: γ A,sum(C) (R) R is block-partitioned or hash-partitioned on K R 1 R 2... R P Reshuffle R on attribute A R 1 R 2 R P... 29

Parallel Join Data: R(K1,A, B), S(K2, B, C) Query: R(K1,A,B) S(K2,B,C) Initially, both R and S are horizontally partitioned on K1 and K2 R 1, S 1 R 2, S 2 R P, S P 30

Parallel Join Data: R(K1,A, B), S(K2, B, C) Query: R(K1,A,B) S(K2,B,C) Reshuffle R on R.B and S on S.B Initially, both R and S are horizontally partitioned on K1 and K2 R 1, S 1 R 2, S 2... R P, S P Each server computes the join locally R 1, S 1 R 2, S 2... R P, S P 31

Data: R(K1,A, B), S(K2, B, C) Query: R(K1,A,B) S(K2,B,C) R1 S1 R2 S2 K1 B K2 B K1 B K2 B Partition 1 20 101 50 3 20 201 20 2 50 102 50 4 20 202 50 M1 M2 Shuffle R1 S1 R2 S2 K1 B K2 B K1 B K2 B Local Join 1 20 3 20 201 20 2 50 101 50 102 50 4 20 M1 M2 202 50 32

Speedup and Scaleup Consider: Query: γ A,sum(C) (R) Runtime: dominated by reading chunks from disk If we double the number of nodes P, what is the new running time? Half (each server holds ½ as many chunks) If we double both P and the size of R, what is the new running time? Same (each server holds the same # of chunks) 33

Uniform Data v.s. Skewed Data Let R(K,A,B,C); which of the following partition methods may result in skewed partitions? Block partition Hash-partition On the key K On the attribute A Uniform Uniform May be skewed Assuming good hash function E.g. when all records have the same value of the attribute A, then all records end up in the same partition 34

Loading Data into a Parallel DBMS Example using Teradata System AMP = Access Module Processor = unit of parallelism 35

Order(oid, item, date), Line(item, ) Example Parallel Query Execution Find all orders from today, along with the items ordered SELECT * FROM Order o, Line i WHERE o.item = i.item AND o.date = today() join o.item = i.item select date = today() scan Item i scan Order o 36

Order(oid, item, date), Line(item, ) Example Parallel Query Execution join o.item = i.item select date = today() scan Order o AMP 1 AMP 2 AMP 3 hash h(o.item) select date=today() hash h(o.item) select date=today() hash h(o.item) select date=today() scan Order o scan Order o scan Order o AMP 1 AMP 2 AMP 3 37

Order(oid, item, date), Line(item, ) Example Parallel join o.item = i.item Query Execution scan Item i date = today() Order o AMP 1 AMP 2 AMP 3 hash h(i.item) hash h(i.item) hash h(i.item) scan Item i scan Item i scan Item i AMP 1 AMP 2 AMP 3 38

Order(oid, item, date), Line(item, ) Example Parallel Query Execution join join join o.item = i.item o.item = i.item o.item = i.item AMP 1 AMP 2 AMP 3 contains all orders and all lines where hash(item) = 2 contains all orders and all lines where hash(item) = 1 contains all orders and all lines where hash(item) = 3 39

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 You will use this extensively in 444 40