Ph.D.
Matt Might, The Illustrated Guide to a Ph.D.: http://matt.might.net/articles/phd-school-in-pictures
Ph.D. Matt Might, The Illustrated Guide to a Ph.D.: - - PowerPoint PPT Presentation
Ph.D. Matt Might, The Illustrated Guide to a Ph.D.: http://matt.might.net/articles/phd-school-in-pictures ONE SIZE DOES NOT FIT ALL Streaming OLAP OLTP Archiving Log-processing Web-search Scan-oriented 4 Streaming OLAP OLTP Archiving
Ph.D.
Matt Might, The Illustrated Guide to a Ph.D.: http://matt.might.net/articles/phd-school-in-pictures
Log-processing Web-search Scan-oriented Archiving
4
Log-processing Web-search Scan-oriented Archiving
4
Log-processing Web-search Scan-oriented Archiving
4
Log-processing Web-search Scan-oriented Archiving
4
Log-processing Web-search Scan-oriented Archiving
4
OLTP
5
5
OLAP
5
Archive
5
Streaming
5
Log-processing
6
Archiving Scan-oriented
Log-processing Web-search
6
7
Raw files Row+Column
1 abc 56 887.9 2 fdg 89 445.35 3 poe 67 234.67 4 lkj 12 385.92 5 yui 17 612.13 6
90 148.9
8
1 abc 56 887.9 2 fdg 89 445.35 3 poe 67 234.67 4 lkj 12 385.92 5 yui 17 612.13 6
90 148.9
8
Log
1 abc 56 887.9 2 fdg 89 445.35 3 poe 67 234.67 4 lkj 12 385.92 5 yui 17 612.13 6
90 148.9
8
Log
Row
1 abc 56 887.9 2 fdg 89 445.35 3 poe 67 234.67 4 lkj 12 385.92 5 yui 17 612.13 6
90 148.9
8
Log
Row Column
1 abc 56 887.9 2 fdg 89 445.35 3 poe 67 234.67 4 lkj 12 385.92 5 yui 17 612.13 6
90 148.9
8
Log
Row Column
Column grouped
1 abc 56 887.9 2 fdg 89 445.35 3 poe 67 234.67 4 lkj 12 385.92 5 yui 17 612.13 6
90 148.9
8
Log
Row Column
Column grouped
Index
1 abc 56 887.9 2 fdg 89 445.35 3 poe 67 234.67 4 lkj 12 385.92 5 yui 17 612.13 6
90 148.9
8
Log
Row Column
Column grouped
Index PAX
Log SV
Result
tickets.customer_id
!
customer.*
( ))
"
a1=x1..an=xn
(
customer.id
9
Log SV
Result
tickets.customer_id
!
customer.*
( ))
"
a1=x1..an=xn
(
customer.id
9
Col SV Row SV Log SV
Result
!
b a g = c u s t
e r s
"
b a g , k e y r e c e n t
#
( ( ) )
!
bag=tickets
"
bag,key recent
#
( ( ))
tickets.customer_id
$
customer.*
( ))
!
a1=x1..an=xn
(
customer.id
tickets customers
Log SV
Result
tickets.customer_id
!
customer.*
( ))
"
a1=x1..an=xn
(
customer.id
Col SV Row SV Log SV
Result
!
bag=customers
"
bag,key recent
#
( ( ))
!
bag=tickets
"
bag,key recent
#
( ( ) )
!
time>=now-7days Col SV
!
t i m e < n
d a y s
Cold
Index SV Index SV
$ id,rid $price,rid
count(*)>=5 customer_id
"
#
( )
tickets.customer_id$
customer.*
( ))
!
a1=x1..an=xn
(
customer.idFrequent Fliers (Adaptive Partial Index)
customer.id tickets.customer_id9
Col SV Row SV Log SV
Result
!
b a g = c u s t
e r s
"
b a g , k e y r e c e n t
#
( ( ) )
!
bag=tickets
"
bag,key recent
#
( ( ))
tickets.customer_id
$
customer.*
( ))
!
a1=x1..an=xn
(
customer.id
tickets customers
Log SV
Result
tickets.customer_id
!
customer.*
( ))
"
a1=x1..an=xn
(
customer.id
Col SV Row SV Log SV
Result
!
bag=customers
"
bag,key recent
#
( ( ))
!
bag=tickets
"
bag,key recent
#
( ( ) )
!
time>=now-7days Col SV
!
t i m e < n
d a y s
Cold
Index SV Index SV
$ id,rid $price,rid
count(*)>=5 customer_id
"
#
( )
tickets.customer_id$
customer.*
( ))
!
a1=x1..an=xn
(
customer.idFrequent Fliers (Adaptive Partial Index)
customer.id tickets.customer_id Primary Log StorePrimary Log Store
9
Col SV Row SV Log SV
Result
!
b a g = c u s t
e r s
"
b a g , k e y r e c e n t
#
( ( ) )
!
bag=tickets
"
bag,key recent
#
( ( ))
tickets.customer_id
$
customer.*
( ))
!
a1=x1..an=xn
(
customer.id
tickets customers
Primary Log Store10
Where’s The Food!
Data Files
copy 1 copy 2 copy 3
Data Files
?
a b
+
Data Files
?
DSL DSL
Logical Data View Physical Data View WWHow! Language Physical Storage Interface
Data Management System
WWHow! Layer
STORE ‘/Users/Bob/Conferences/Talks/*.*’ WHAT *.(pdf | ppt), *.pdf WHERE vise4 HOW encryption(rsa) FOR *;
Store my conferences talks (PDFs 2x and PPTs 1x) using RSA compression on University server
I want my conference talks to be highly available
STORE ‘/Users/Bob/Conferences/Talks/*.*’ WHAT *.(pdf | ppt), *.pdf HOW encryption(rsa) FOR * PREFERENCE Availability=‘high’;
I want my conference talks to be highly available
job for the WWhow! data storage optimizer
STORE ‘/Users/Bob/Conferences/Talks/*.*’ WHAT *.(pdf | ppt), *.pdf HOW encryption(rsa) FOR * PREFERENCE Availability=‘high’;
19
Vision
21
23
UDF Storage Layer Query Processor Relations Physical Representation
File 1 File 2 File 3 File n ....
Application
User Database24
Customer name phone market_segment smith 2134 automobile john 3425 household kim 6756 furniture joe 9878 building mark 4312 building steve 2435 automobile jim 5766 household ian 8789 household
Customer_trojan segment_ID attribute_ID blob_data 1 name smith, john, kim, joe 1 phone 2134, 3425, 6756, 9878 1 market_segment automobile, household, furniture, building 2 name mark, steve, jim, ian 2 phone 4312, 2435, 5766, 8789 2 market_segment building, automobile, household, household
Relation Physical Table
24
Customer name phone market_segment smith 2134 automobile john 3425 household kim 6756 furniture joe 9878 building mark 4312 building steve 2435 automobile jim 5766 household ian 8789 household
Customer_trojan segment_ID attribute_ID blob_data 1 name smith, john, kim, joe 1 phone 2134, 3425, 6756, 9878 1 market_segment automobile, household, furniture, building 2 name mark, steve, jim, ian 2 phone 4312, 2435, 5766, 8789 2 market_segment building, automobile, household, household
Relation Physical Table
write-UDF
25
Customer name phone market_segment smith 2134 automobile john 3425 household kim 6756 furniture joe 9878 building mark 4312 building steve 2435 automobile jim 5766 household ian 8789 household
Customer_trojan segment_ID attribute_ID blob_data 1 name smith, john, kim, joe 1 phone 2134, 3425, 6756, 9878 1 market_segment automobile, household, furniture, building 2 name mark, steve, jim, ian 2 phone 4312, 2435, 5766, 8789 2 market_segment building, automobile, household, household
Relation Physical Table
read-UDF
Result
quantity, discount extendedprice, shipdate shipdate BETWEEN ‘1994-01-01’ AND ‘1995-01-01’ AND discount BETWEEN 0.05 AND 0.07 AND quantity < 24
σ π
agg (extendedprice * discount)
γ
lineitem
SCAN
26
Result
quantity, discount extendedprice, shipdate shipdate BETWEEN ‘1994-01-01’ AND ‘1995-01-01’ AND discount BETWEEN 0.05 AND 0.07 AND quantity < 24
σ π
agg (extendedprice * discount)
γ
lineitem
SCAN
shipd
scanUDF
scanUDF Result
quantity, discount extendedprice, shipdate shipdate BETWEEN ‘1994-01-01’ AND ‘1995-01-01’ AND discount BETWEEN 0.05 AND 0.07 AND quantity < 24
σ π
agg (extendedprice * discount)
γ
lineitem
SCAN
26
Result
quantity, discount extendedprice, shipdate shipdate BETWEEN ‘1994-01-01’ AND ‘1995-01-01’ AND discount BETWEEN 0.05 AND 0.07 AND quantity < 24
σ π
agg (extendedprice * discount)
γ
lineitem
SCAN
shipd
scanUDF
scanUDF Result
quantity, discount extendedprice, shipdate shipdate BETWEEN ‘1994-01-01’ AND ‘1995-01-01’ AND discount BETWEEN 0.05 AND 0.07 AND quantity < 24
σ π
agg (extendedprice * discount)
γ
lineitem
SCAN
σ
te BETWEEN
σ
selectUDF
σ
selectUDF Result
quantity, discount extendedprice, shipdate shipdate BETWEEN ‘1994-01-01’ AND ‘1995-01-01’ AND discount BETWEEN 0.05 AND 0.07 AND quantity < 24
σ π
agg (extendedprice * discount)
γ
lineitem
SCAN
26
10 20 30 Q1 Q2 Q3 Q4 Q5 Q6 Q7 Query Time (sec)
Standard Row Trojan Columns
71.74058 72.41696
Benchmark Results *
27
* Mike Stonebraker et. al. C-Store: A Column Oriented DBMS. VLDB 2005
10 20 30 Q1 Q2 Q3 Q4 Q5 Q6 Q7 Query Time (sec)
Standard Row Trojan Columns
71.74058 72.41696
Benchmark Results *
27
* Mike Stonebraker et. al. C-Store: A Column Oriented DBMS. VLDB 2005
5x
29
30
31
0.01 0.1 1 10 100 1,000 10,000 Optimization time (s) AutoPart HillClimb HYRISE Navathe O2P Trojan BruteForce
32
5 10 AutoPart HillClimb HYRISE Navathe O2P Trojan BruteForce
Percentage Difference from Column Layouts [%] TPC-H SSB
33
0% 25% 50% 75% 100% 125% 150% 0.01 0.1 1 10 100 1,000 10,000 Normalized estd. costs (%) Buffer Size (MB, log scale)
HillClimb Navathe Materialized views Column
Comparison’s Paper: Hadoop Vs PDBMS
Comparison’s Paper: Hadoop Vs PDBMS
1 Nodes 10 Nodes 25 Nodes 50 Nodes 100 Nodes 20 40 60 80 100 120 140 160 seconds
← 0.3 ← 0.8 ← 1.8 ← 4.7 ← 12.4 Vertica Hadoop1 Nodes 10 Nodes 25 Nodes 50 Nodes 100 Nodes 200 400 600 800 1000 1200 1400 1600 1800 seconds
← 21.5 ← 28.2 ← 31.3 ← 36.1 ← 85.0 ← 15.7 ← 28.0 ← 29.2 ← 29.4 ← 31.9 Vertica DBMS−X HadoopSelection Task Join Task
Map Phase Shuffle Phase Reduce Phase
.. Client Data Node 1 .. .. Data Node 3 Mapper 1 Mapper 3 Reducer 1
Map Phase Shuffle Phase Reduce Phase
..
Map Phase Shuffle Phase Reduce Phase
..
sh(key k, value v, int numPartitions) k.splitID % numPartitions cmp(key k1, key k2) compare(k1.a , k2.a) grp(key k1, key k2) compare(k1.splitID , k2.splitID)
map(key k, value v) [(getSplitID() ⌅ prjai(k ⌅ v), k ⌅ v)] (key ik vset ivs)
⌅ ⌅ reduce(key ik, vset ivs) [(ivs ⌅ indexBuilderai(ivs))]
37
38
38
size
Algorithm 3: Trojan Index itemize.next UDF Input : KeyType key, ValueType value Output: has more records if offset < splitEnd then 1 Record nextRecord = ReadNextRecord(split); 238
20 40 60 80 100 120 140 10 nodes 50 nodes 100 nodes runtime [seconds] Hadoop HadoopDB HadoopDB Chunks Hadoop++(256MB) Hadoop++(1GB)
39
* Pavlo et. al. A Comparison of Approaches to large-Scale Data Analysis. SIGMOD 2009
500 1000 1500 2000 2500 10 nodes 50 nodes 100 nodes runtime [seconds] Hadoop HadoopDB Hadoop++(256MB) Hadoop++(1GB)
40
* Pavlo et. al. A Comparison of Approaches to large-Scale Data Analysis. SIGMOD 2009
41
42
43 001 alex bsc 002 tim msc 003 mat bsc 004 joel bsc 005 phil msc 006 ron msc 007 neo bsc 008 jack msc 009 jens bsc 010 tom msc
Row Column* PAX**
(default)
* A. Floratou et al. Column-Oriented Storage Techniques for MapReduce. PVLDB, April, 2011 **
44
Row Column PAX
Non-required Reads Network Costs Data Block Placement Tuple Reconstruction
45
Replica 2 Replica 1 Replica 3
46
Non-required Reads Network Costs Data Block Placement Tuple Reconstruction
Row Column PAX Trojan
47
#Non-required Attributes Read #Joins in Tuple Reconstruction
HADOOP-ROW 525 HADOOP-PAX 139 Trojan Layout 14 20
1 2 3 4 5 Q1 Q2 Q3 Q4 Q5 Q6 Q7 Q8
Improvement Factor TPC-H Queries
48
Hadoop Aggressive Indexing Library
Individual Jobs: Weblog, RecordReader
1000 2000 3000 4000 Bob-Q1 Bob-Q2 Bob-Q3 Bob-Q4 Bob-Q5
683 333 52 75 73 2864 2917 53 83 2776 2442 2470 21 12 2156 3358
RR Runtime [ms] MapReduce Jobs
Hadoop Hadoop ++ HAIL
54
HDFS MapReduce Cartilage Query Engine Cartilage Upload Pipeline Hive HBase Pig
Data File 1 Data File 2 Data File n
...
55
HDFS Cartilage Query Engine Cartilage Upload Pipeline Input Data Queried Data
56
Serializer Parser
Data
Physical Partitioner Uploader
HDFS Stage 5 Stage 3 Stage 2 Stage 1 Block 3 Block 1
Logical Partitioner
Stage 4 Block 2
57
Parser Replicator 1
Data
Block 2
Locator 2 Physical Partitioner 2 Logical Partitioner Serializer 3 Locator 1 Uploader
HDFS
Physical Partitioner 1 Serializer 2 Serializer 1 Replicator 2
replica 1 replica 2 replica 1a replica 1bBlock 1 Block 4 Block 3 Block 5
58
59
ONE SIZE DOES NOT FIT ALL
CIDR 2011
HYRISE
WWHow! Layer
CIDR 2013 VLDB 2013 CIDR 2013 VLDB 2010 SOCC 2011 VLDB 2012 SIGMOD (demo)
60