James Taylor @ JamesPlusPlus hbase.blogspot.com

84
Phoenix James Taylor @JamesPlusPlus http://phoenix- hbase.blogspot.com/ We put the SQL back in NoSQL https://github.com/forcedotcom/ phoenix

description

James Taylor @ JamesPlusPlus http://phoenix- hbase.blogspot.com /. Phoenix. We put the SQL back in NoSQL https:// github.com/forcedotcom/phoenix. Agenda. What/why HBase ? What/why Phoenix? How does Phoenix work? Demo Roadmap Q&A. Completed. What is HBase ?. - PowerPoint PPT Presentation

Transcript of James Taylor @ JamesPlusPlus hbase.blogspot.com

Page 1: James Taylor @ JamesPlusPlus  hbase.blogspot.com

Phoenix

James Taylor@JamesPlusPlushttp://phoenix-hbase.blogspot.com/

We put the SQL back in NoSQLhttps://github.com/forcedotcom/phoenix

Page 2: James Taylor @ JamesPlusPlus  hbase.blogspot.com

Agenda

Completed

What/why HBase?What/why Phoenix?How does Phoenix work?DemoRoadmapQ&A

Page 3: James Taylor @ JamesPlusPlus  hbase.blogspot.com

What is HBase?

Completed

Developed as part of Apache HadoopRuns on top of HDFS Key/value store

SparseConsistentDistributedMultidimensionalSorted

Page 4: James Taylor @ JamesPlusPlus  hbase.blogspot.com
Page 5: James Taylor @ JamesPlusPlus  hbase.blogspot.com

Why Use HBase?

Completed

If you have lots of dataScales linearlyShards automatically

If you can live without transactionsIf your data changesIf you need strict consistency

Page 6: James Taylor @ JamesPlusPlus  hbase.blogspot.com
Page 7: James Taylor @ JamesPlusPlus  hbase.blogspot.com

What is Phoenix?

Completed

Page 8: James Taylor @ JamesPlusPlus  hbase.blogspot.com

What is Phoenix?

Completed

SQL skin for HBase

Page 9: James Taylor @ JamesPlusPlus  hbase.blogspot.com

What is Phoenix?

Completed

SQL skin for HBaseAlternate client API

Page 10: James Taylor @ JamesPlusPlus  hbase.blogspot.com

What is Phoenix?

Completed

SQL skin for HBaseAlternate client APIEmbedded JDBC driver

Page 11: James Taylor @ JamesPlusPlus  hbase.blogspot.com

What is Phoenix?

Completed

SQL skin for HBaseAlternate client APIEmbedded JDBC driverRuns at HBase native speed

Page 12: James Taylor @ JamesPlusPlus  hbase.blogspot.com

What is Phoenix?

Completed

SQL skin for HBaseAlternate client APIEmbedded JDBC driverRuns at HBase native speedCompiles your SQL into native HBase calls

Page 13: James Taylor @ JamesPlusPlus  hbase.blogspot.com

What is Phoenix?

Completed

SQL skin for HBaseAlternate client APIEmbedded JDBC driverRuns at HBase native speedCompiles your SQL into native HBase calls

So you don’t have to!

Page 14: James Taylor @ JamesPlusPlus  hbase.blogspot.com
Page 15: James Taylor @ JamesPlusPlus  hbase.blogspot.com

Phoenix

Page 16: James Taylor @ JamesPlusPlus  hbase.blogspot.com

Phoenix

Phoenix

Page 17: James Taylor @ JamesPlusPlus  hbase.blogspot.com

Phoenix Performance

Page 18: James Taylor @ JamesPlusPlus  hbase.blogspot.com

Why Use Phoenix?

Completed

Give folks an API they already know

Page 19: James Taylor @ JamesPlusPlus  hbase.blogspot.com

Why Use Phoenix?

Completed

Give folks an API they already knowReduce the amount of code needed

Page 20: James Taylor @ JamesPlusPlus  hbase.blogspot.com

Why Use Phoenix?

Completed

Give folks an API they already knowReduce the amount of code needed

SELECT TRUNC(date,'DAY’), AVG(cpu)FROM web_statWHERE domain LIKE 'Salesforce%’GROUP BY TRUNC(date,'DAY’)

Page 21: James Taylor @ JamesPlusPlus  hbase.blogspot.com

Why Use Phoenix?

Completed

Give folks an API they already knowReduce the amount of code neededPerform optimizations transparently

Page 22: James Taylor @ JamesPlusPlus  hbase.blogspot.com

Why Use Phoenix?

Completed

Give folks an API they already knowReduce the amount of code neededPerform optimizations transparently

AggregationSkip ScanSecondary indexing (soon!)

Page 23: James Taylor @ JamesPlusPlus  hbase.blogspot.com

Why Use Phoenix?

Completed

Give folks an API they already knowReduce the amount of code neededPerform optimizations transparentlyLeverage existing tooling

Page 24: James Taylor @ JamesPlusPlus  hbase.blogspot.com

Why Use Phoenix?

Completed

Give folks an API they already knowReduce the amount of code neededPerform optimizations transparentlyLeverage existing tooling

SQL client/terminalOLAP engine

Page 25: James Taylor @ JamesPlusPlus  hbase.blogspot.com

How Does Phoenix Work?

Completed

Overlays HBase Data ModelVersioned Schema RespositoryQuery Processor

Page 26: James Taylor @ JamesPlusPlus  hbase.blogspot.com

Phoenix Data Model

HBase Table

Phoenix maps HBase data model to the relational world

Page 27: James Taylor @ JamesPlusPlus  hbase.blogspot.com

Phoenix Data Model

HBase TableColumn Family A Column Family B

Phoenix maps HBase data model to the relational world

Page 28: James Taylor @ JamesPlusPlus  hbase.blogspot.com

Phoenix Data Model

HBase TableColumn Family A Column Family B

Qualifier 1 Qualifier 2 Qualifier 3

Phoenix maps HBase data model to the relational world

Page 29: James Taylor @ JamesPlusPlus  hbase.blogspot.com

Phoenix Data Model

HBase TableColumn Family A Column Family B

Qualifier 1 Qualifier 2 Qualifier 3

Row Key 1 Value

Phoenix maps HBase data model to the relational world

Page 30: James Taylor @ JamesPlusPlus  hbase.blogspot.com

Phoenix Data Model

HBase TableColumn Family A Column Family B

Qualifier 1 Qualifier 2 Qualifier 3

Row Key 1 Value

Row Key 2 Value Value

Phoenix maps HBase data model to the relational world

Page 31: James Taylor @ JamesPlusPlus  hbase.blogspot.com

Phoenix Data Model

HBase TableColumn Family A Column Family B

Qualifier 1 Qualifier 2 Qualifier 3

Row Key 1 Value

Row Key 2 Value Value

Row Key 3 Value

Phoenix maps HBase data model to the relational world

Page 32: James Taylor @ JamesPlusPlus  hbase.blogspot.com

HBase TableColumn Family A Column Family B

Qualifier 1 Qualifier 2 Qualifier 3

Row Key 1 Value

Row Key 2 Value Value

Row Key 3 Value

Phoenix Data Model

HBase TableColumn Family A Column Family B

Qualifier 1 Qualifier 2 Qualifier 3

Row Key 1 Value

Row Key 2 Value Value

Row Key 3 Value

Phoenix maps HBase data model to the relational world

Page 33: James Taylor @ JamesPlusPlus  hbase.blogspot.com

HBase TableColumn Family A Column Family B

Qualifier 1 Qualifier 2 Qualifier 3

Row Key 1 Value

Row Key 2 Value Value

Row Key 3 Value

HBase TableColumn Family A Column Family B

Qualifier 1 Qualifier 2 Qualifier 3

Row Key 1 Value

Row Key 2 Value Value

Row Key 3 Value

Phoenix Data Model

HBase TableColumn Family A Column Family B

Qualifier 1 Qualifier 2 Qualifier 3

Row Key 1 Value

Row Key 2 Value Value

Row Key 3 Value

Phoenix maps HBase data model to the relational world

Page 34: James Taylor @ JamesPlusPlus  hbase.blogspot.com

HBase TableColumn Family A Column Family B

Qualifier 1 Qualifier 2 Qualifier 3

Row Key 1 Value

Row Key 2 Value Value

Row Key 3 Value

HBase TableColumn Family A Column Family B

Qualifier 1 Qualifier 2 Qualifier 3

Row Key 1 Value

Row Key 2 Value Value

Row Key 3 Value

Phoenix Data Model

HBase TableColumn Family A Column Family B

Qualifier 1 Qualifier 2 Qualifier 3

Row Key 1 Value

Row Key 2 Value Value

Row Key 3 Value

Phoenix maps HBase data model to the relational world

Multiple Versions

Page 35: James Taylor @ JamesPlusPlus  hbase.blogspot.com

Phoenix Data Model

HBase TableColumn Family A Column Family B

Qualifier 1 Qualifier 2 Qualifier 3

Row Key 1 Value

Row Key 2 Value Value

Row Key 3 Value

Phoenix maps HBase data model to the relational world

Phoenix Table

Page 36: James Taylor @ JamesPlusPlus  hbase.blogspot.com

Phoenix Data Model

HBase TableColumn Family A Column Family B

Qualifier 1 Qualifier 2 Qualifier 3

Row Key 1 Value

Row Key 2 Value Value

Row Key 3 Value

Phoenix maps HBase data model to the relational world

Phoenix Table

Key Value Columns

Page 37: James Taylor @ JamesPlusPlus  hbase.blogspot.com

Phoenix Data Model

HBase TableColumn Family A Column Family B

Qualifier 1 Qualifier 2 Qualifier 3

Row Key 1 Value

Row Key 2 Value Value

Row Key 3 Value

Phoenix maps HBase data model to the relational world

Phoenix Table

Key Value ColumnsRow Key Columns

Page 38: James Taylor @ JamesPlusPlus  hbase.blogspot.com

Phoenix Metadata

Completed

Stored in a Phoenix HBase table SYSTEM.TABLE

Page 39: James Taylor @ JamesPlusPlus  hbase.blogspot.com

Phoenix Metadata

Completed

Stored in a Phoenix HBase table SYSTEM.TABLE

Updated through DDL commands CREATE TABLE ALTER TABLE DROP TABLE CREATE INDEX DROP INDEX

Page 40: James Taylor @ JamesPlusPlus  hbase.blogspot.com

Phoenix Metadata

Completed

Stored in a Phoenix HBase table SYSTEM.TABLE

Updated through DDL commands CREATE TABLE ALTER TABLE DROP TABLE CREATE INDEX DROP INDEX

Keeps older versions as schema evolves

Page 41: James Taylor @ JamesPlusPlus  hbase.blogspot.com

Phoenix Metadata

Completed

Stored in a Phoenix HBase table SYSTEM.TABLE

Updated through DDL commands CREATE TABLE ALTER TABLE DROP TABLE CREATE INDEX DROP INDEX

Keeps older versions as schema evolves Correlates timestamps between schema and data

Flashback queries use schema was in-place then

Page 42: James Taylor @ JamesPlusPlus  hbase.blogspot.com

Phoenix Metadata

Completed

Stored in a Phoenix HBase table SYSTEM.TABLE

Updated through DDL commands CREATE TABLE ALTER TABLE DROP TABLE CREATE INDEX DROP INDEX

Keeps older versions as schema evolves Correlates timestamps between schema and data

Flashback queries use schema was in-place then Accessible via JDBC metadata APIs

java.sql.DatabaseMetaData Through Phoenix queries!

Page 43: James Taylor @ JamesPlusPlus  hbase.blogspot.com

Example

Row Key

Server MetricsHOST VARCHAR

DATE DATE

RESPONSE_TIME INTEGER

GC_TIME INTEGER

CPU_TIME INTEGER

IO_TIME INTEGER

Over metrics data for clusters of servers with a schema like this:

Page 44: James Taylor @ JamesPlusPlus  hbase.blogspot.com

Example

Server MetricsHOST VARCHAR

DATE DATE

RESPONSE_TIME INTEGER

GC_TIME INTEGER

CPU_TIME INTEGER

IO_TIME INTEGER

Over metrics data for clusters of servers with a schema like this:

Key Values

Page 45: James Taylor @ JamesPlusPlus  hbase.blogspot.com

ExampleWith 90 days of data that looks like this:

SERVER METRICSHOST DATE RESPONSE_TIME GC_TIME

sf1.s1 Jun 5 10:10:10.234 1234

sf1.s1 Jun 5 11:18:28.456 8012

sf3.s1 Jun 5 10:10:10.234 2345

sf3.s1 Jun 6 12:46:19.123 2340

sf7.s9 Jun 4 08:23:23.456 5002 1234

Page 46: James Taylor @ JamesPlusPlus  hbase.blogspot.com

ExampleWalk through query processing for three scenarios

1. Chart Response Time Per Cluster

Page 47: James Taylor @ JamesPlusPlus  hbase.blogspot.com

ExampleWalk through query processing for three scenarios

1. Chart Response Time Per Cluster

Page 48: James Taylor @ JamesPlusPlus  hbase.blogspot.com

ExampleWalk through query processing for three scenarios

1. Chart Response Time Per Cluster

2. Identify 5 Longest GC Times

Page 49: James Taylor @ JamesPlusPlus  hbase.blogspot.com

ExampleWalk through query processing for three scenarios

1. Chart Response Time Per Cluster

2. Identify 5 Longest GC Times

Page 50: James Taylor @ JamesPlusPlus  hbase.blogspot.com

ExampleWalk through query processing for three scenarios

1. Chart Response Time Per Cluster

2. Identify 5 Longest GC Times

3. Identify 5 Longest GC Times again and again

Page 51: James Taylor @ JamesPlusPlus  hbase.blogspot.com

Scenario 1Chart Response Time Per Cluster

Completed

SELECT substr(host,1,3), trunc(date,’DAY’), avg(response_time)FROM server_metricsWHERE date > CURRENT_DATE() – 7AND substr(host, 1, 3) IN (‘sf1’, ‘sf3, ‘sf7’)GROUP BY substr(host, 1, 3), trunc(date,’DAY’)

Page 52: James Taylor @ JamesPlusPlus  hbase.blogspot.com

Scenario 1Chart Response Time Per Cluster

Completed

SELECT substr(host,1,3), trunc(date,’DAY’), avg(response_time)FROM server_metricsWHERE date > CURRENT_DATE() – 7AND substr(host, 1, 3) IN (‘sf1’, ‘sf3, ‘sf7’)GROUP BY substr(host, 1, 3), trunc(date,’DAY’)

Page 53: James Taylor @ JamesPlusPlus  hbase.blogspot.com

Scenario 1Chart Response Time Per Cluster

Completed

SELECT substr(host,1,3), trunc(date,’DAY’), avg(response_time)FROM server_metricsWHERE date > CURRENT_DATE() – 7AND substr(host, 1, 3) IN (‘sf1’, ‘sf3, ‘sf7’)GROUP BY substr(host, 1, 3), trunc(date,’DAY’)

Page 54: James Taylor @ JamesPlusPlus  hbase.blogspot.com

Scenario 1Chart Response Time Per Cluster

Completed

SELECT substr(host,1,3), trunc(date,’DAY’), avg(response_time)FROM server_metricsWHERE date > CURRENT_DATE() – 7AND substr(host, 1, 3) IN (‘sf1’, ‘sf3, ‘sf7’)GROUP BY substr(host, 1, 3), trunc(date,’DAY’)

Page 55: James Taylor @ JamesPlusPlus  hbase.blogspot.com

Scenario 1Chart Response Time Per Cluster

Completed

SELECT substr(host,1,3), trunc(date,’DAY’), avg(response_time)FROM server_metricsWHERE date > CURRENT_DATE() – 7AND substr(host, 1, 3) IN (‘sf1’, ‘sf3, ‘sf7’)GROUP BY substr(host, 1, 3), trunc(date,’DAY’)

Page 56: James Taylor @ JamesPlusPlus  hbase.blogspot.com

Step 1: ClientIdentify Row Key Ranges from Query

Completed

SELECT substr(host,1,3), trunc(date,’DAY’), avg(response_time)FROM server_metricsWHERE date > CURRENT_DATE() – 7AND substr(host, 1, 3) IN (‘sf1’, ‘sf3’, ‘sf7’)GROUP BY substr(host, 1, 3), trunc(date,’DAY’)

Row Key RangesHOST DATE

Page 57: James Taylor @ JamesPlusPlus  hbase.blogspot.com

Step 1: ClientIdentify Row Key Ranges from Query

Completed

SELECT substr(host,1,3), trunc(date,’DAY’), avg(response_time)FROM server_metricsWHERE date > CURRENT_DATE() – 7AND substr(host, 1, 3) IN (‘sf1’, ‘sf3’, ‘sf7’)GROUP BY substr(host, 1, 3), trunc(date,’DAY’)

Row Key RangesHOST DATE

Page 58: James Taylor @ JamesPlusPlus  hbase.blogspot.com

Step 1: ClientIdentify Row Key Ranges from Query

Completed

SELECT substr(host,1,3), trunc(date,’DAY’), avg(response_time)FROM server_metricsWHERE date > CURRENT_DATE() – 7AND substr(host, 1, 3) IN (‘sf1’, ‘sf3’, ‘sf7’)GROUP BY substr(host, 1, 3), trunc(date,’DAY’)

Row Key RangesHOST DATE

Page 59: James Taylor @ JamesPlusPlus  hbase.blogspot.com

Step 1: ClientIdentify Row Key Ranges from Query

Completed

SELECT substr(host,1,3), trunc(date,’DAY’), avg(response_time)FROM server_metricsWHERE date > CURRENT_DATE() – 7AND substr(host, 1, 3) IN (‘sf1’, ‘sf3’, ‘sf7’)GROUP BY substr(host, 1, 3), trunc(date,’DAY’)

Row Key RangesHOST DATE

sf1

Page 60: James Taylor @ JamesPlusPlus  hbase.blogspot.com

Step 1: ClientIdentify Row Key Ranges from Query

Completed

SELECT substr(host,1,3), trunc(date,’DAY’), avg(response_time)FROM server_metricsWHERE date > CURRENT_DATE() – 7AND substr(host, 1, 3) IN (‘sf1’, ‘sf3’, ‘sf7’)GROUP BY substr(host, 1, 3), trunc(date,’DAY’)

Row Key RangesHOST DATE

sf1

sf3

Page 61: James Taylor @ JamesPlusPlus  hbase.blogspot.com

Step 1: ClientIdentify Row Key Ranges from Query

Completed

SELECT substr(host,1,3), trunc(date,’DAY’), avg(response_time)FROM server_metricsWHERE date > CURRENT_DATE() – 7AND substr(host, 1, 3) IN (‘sf1’, ‘sf3’, ‘sf7’)GROUP BY substr(host, 1, 3), trunc(date,’DAY’)

Row Key RangesHOST DATE

sf1

sf3

sf7

Page 62: James Taylor @ JamesPlusPlus  hbase.blogspot.com

Step 1: ClientIdentify Row Key Ranges from Query

Completed

SELECT substr(host,1,3), trunc(date,’DAY’), avg(response_time)FROM server_metricsWHERE date > CURRENT_DATE() – 7AND substr(host, 1, 3) IN (‘sf1’, ‘sf3’, ‘sf7’)GROUP BY substr(host, 1, 3), trunc(date,’DAY’)

Row Key RangesHOST DATE

sf1 t1 – *

sf3

sf7

Page 63: James Taylor @ JamesPlusPlus  hbase.blogspot.com

Step 2: ClientOverlay Row Key Ranges with Regions

Completed

R1

R2

R3

R4

sf1

sf4

sf6

sf1sf3

sf7

Page 64: James Taylor @ JamesPlusPlus  hbase.blogspot.com

Step 3: ClientExecute Parallel Scans

Completed

R1

R2

R3

R4

sf1

sf4

sf6

sf1

sf3

sf7

scan1

scan3

scan2

Page 65: James Taylor @ JamesPlusPlus  hbase.blogspot.com

Step 4: ServerFilter using Skip Scan

Completed

sf1.s1 t0SKIP

Page 66: James Taylor @ JamesPlusPlus  hbase.blogspot.com

Step 4: ServerFilter using Skip Scan

Completed

sf1.s1 t1INCLUDE

Page 67: James Taylor @ JamesPlusPlus  hbase.blogspot.com

Step 4: ServerFilter using Skip Scan

Completed

sf1.s2 t0SKIP

Page 68: James Taylor @ JamesPlusPlus  hbase.blogspot.com

Step 4: ServerFilter using Skip Scan

Completedsf1.s2 t1INCLUDE

Page 69: James Taylor @ JamesPlusPlus  hbase.blogspot.com

Step 4: ServerFilter using Skip Scan

sf1.s3 t0SKIP

Page 70: James Taylor @ JamesPlusPlus  hbase.blogspot.com

Step 4: ServerFilter using Skip Scan

sf1.s3 t1INCLUDE

Page 71: James Taylor @ JamesPlusPlus  hbase.blogspot.com

SERVER METRICSHOST DATE

sf1.s1 Jun 2 10:10:10.234

sf1.s2 Jun 3 23:05:44.975

sf1.s2 Jun 9 08:10:32.147

sf1.s3 Jun 1 11:18:28.456

sf1.s3 Jun 3 22:03:22.142

sf1.s4 Jun 1 10:29:58.950

sf1.s4 Jun 2 14:55:34.104

sf1.s4 Jun 3 12:46:19.123

sf1.s5 Jun 8 08:23:23.456

sf1.s6 Jun 1 10:31:10.234

Step 5: ServerIntercept Scan in Coprocessor

SERVER METRICSHOST DATE AGG

sf1 Jun 1 …

sf1 Jun 2 …

sf1 Jun 3 …

sf1 Jun 8 …

sf1 Jun 9 …

Page 72: James Taylor @ JamesPlusPlus  hbase.blogspot.com

Step 6: ClientPerform Final Merge Sort

Completed

R1

R2

R3

R4

scan1

scan3

scan2

SERVER METRICSHOST DATE AGG

sf1 Jun 5 …

sf1 Jun 9 …

sf3 Jun 1 …

sf3 Jun 2 …

sf7 Jun 1 …

sf7 Jun 8 …

Page 73: James Taylor @ JamesPlusPlus  hbase.blogspot.com

Scenario 2Find 5 Longest GC Times

Completed

SELECT host, date, gc_timeFROM server_metricsWHERE date > CURRENT_DATE() – 7AND substr(host, 1, 3) IN (‘sf1’, ‘sf3, ‘sf7’)ORDER BY gc_time DESCLIMIT 5

Page 74: James Taylor @ JamesPlusPlus  hbase.blogspot.com

Scenario 2Find 5 Longest GC Times

•Same client parallelization and server skip scan filtering

Page 75: James Taylor @ JamesPlusPlus  hbase.blogspot.com

Scenario 2Find 5 Longest GC Times

Completed

•Same client parallelization and server skip scan filtering•Server holds 5 longest GC_TIME value for each scan

R2

SERVER METRICSHOST DATE GC_TIME

sf1.s1 Jun 2 10:10:10.234 22123

sf1.s1 Jun 3 23:05:44.975 19876

sf1.s1 Jun 9 08:10:32.147 11345

sf1.s2 Jun 1 11:18:28.456 10234

sf1.s2 Jun 3 22:03:22.142 10111

Page 76: James Taylor @ JamesPlusPlus  hbase.blogspot.com

Scenario 2Find 5 Longest GC Times

Completed

•Same client parallelization and server skip scan filtering•Server holds 5 longest GC_TIME value for each scan•Client performs final merge sort among parallel scans

Scan1SERVER METRICS

HOST DATE GC_TIME

sf1.s1 Jun 2 10:10:10.234 25865

sf1.s1 Jun 3 23:05:44.975 22123

sf1.s1 Jun 9 08:10:32.147 20176

sf1.s2 Jun 1 11:18:28.456 19876

sf1.s2 Jun 3 22:03:22.142 17111

Scan2

Scan3

Page 77: James Taylor @ JamesPlusPlus  hbase.blogspot.com

Scenario 3Find 5 Longest GC Times

Completed

CREATE INDEX gc_time_indexON server_metrics (gc_time DESC, date DESC)INCLUDE (host, response_time)

Page 78: James Taylor @ JamesPlusPlus  hbase.blogspot.com

Scenario 3Find 5 Longest GC Times

Completed

CREATE INDEX gc_time_indexON server_metrics (gc_time DESC, date DESC)INCLUDE (host, response_time)

Page 79: James Taylor @ JamesPlusPlus  hbase.blogspot.com

Scenario 3Find 5 Longest GC Times

Completed

CREATE INDEX gc_time_indexON server_metrics (gc_time DESC, date DESC)INCLUDE (host, response_time)

Page 80: James Taylor @ JamesPlusPlus  hbase.blogspot.com

Scenario 3Find 5 Longest GC Times

Completed

CREATE INDEX gc_time_indexON server_metrics (gc_time DESC, date DESC)INCLUDE (host, response_time)

Row Key

Server Metrics GC Time IndexGC_TIME INTEGER

DATE DATE

HOST VARCHAR

RESPONSE_TIME INTEGER

Page 81: James Taylor @ JamesPlusPlus  hbase.blogspot.com

Scenario 3Find 5 Longest GC Times

Completed

SELECT host, date, gc_timeFROM server_metricsWHERE date > CURRENT_DATE() – 7AND substr(host, 1, 3) IN (‘sf1’, ‘sf3, ‘sf7’)ORDER BY gc_time DESCLIMIT 5

Page 82: James Taylor @ JamesPlusPlus  hbase.blogspot.com

Demo

Completed

Phoenix Stock AnalyzerFortune 500 companies10 years of historical stock pricesDemonstrates Skip Scan in actionRunning locally on my single node laptop cluster

Page 83: James Taylor @ JamesPlusPlus  hbase.blogspot.com

Phoenix Roadmap

Completed

Secondary Indexing Hash Joins Apache Drill integration Count distinct and percentile Derived tables

SELECT * FROM (SELECT * FROM t) Cost-based query optimizer OLAP extensions

WINDOW, PARTITION OVER, RANK Monitoring and management Transactions

Page 84: James Taylor @ JamesPlusPlus  hbase.blogspot.com

Thank you!Questions/comments?