SlideShare uma empresa Scribd logo
1 de 40
Baixar para ler offline
Enable SQL/JDBC Access to Apache
Geode/GemFire Using Apache Calcite
By Christian Tzolov
@christzolov
1
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Christian Tzolov
Spring Software Engineer at Pivotal
Spring Cloud Data Flow
Apache Committer, Crunch PMC member
Apache {Crunch, HAWQ, Zeppelin, Calcite...}
2
blog.tzolov.net
@christzolov
@tzolov
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
“What happens if an established NoSQL database
decides to implement a reasonably standard SQL;
The only predictable outcome for such an
eventuality is plenty of argument.”
Martin Fowler, P.J.Sadalage, NoSQL Distilled, 2012
3
Disclaimer
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Safe Harbor Statement
The following is intended to outline the general direction of Pivotal's offerings. It is
intended for information purposes only and may not be incorporated into any
contract. Any information regarding pre-release of Pivotal offerings, future updates
or other planned modifications is subject to ongoing evaluation by Pivotal and is
subject to change. This information is provided without warranty or any kind,
express or implied, and is not a commitment to deliver any material, code, or
functionality, and should not be relied upon in making purchasing decisions
regarding Pivotal's offerings. These purchasing decisions should only be based on
features currently available. The development, release, and timing of any features
or functionality described for Pivotal's offerings in this presentation remain at the
sole discretion of Pivotal. Pivotal has no obligation to update forward looking
information in this presentation.
5
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Demo?
In a minute ;)
6
Data Management Systems
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
8
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
One Size Fit All*
“The traditional DBMS architecture has been used to support many
data-centric applications with widely varying characteristics and
requirements
 We argue that this concept is no longer applicable to the
database market, and that the commercial world will fracture into a
collection of independent database engines, some of which may be
unified by a common front-end parser.”
Michael Stonebraker, 2005
9
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Collection of Independent Databases
10
How to ingest and keep
consistent across DBs?
How to access the data
across multiple DBs?
Data Federation
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Federation: Unified Query Interface
12
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Federation: Two Mapping Tasks
13
Federation: Data Model Mapping
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Geode Model Mapping
‱ PDX serialization
‱ Primitive Types
‱ Arrays (employ[0])
‱ Nested Objects
(parent[‘child.childChild
’])
15
Cache
Region 1
Region K
ValKey
v1k1
v2k2
Schema
Table 1
Table K
C
o
l
1
C
o
l
2
C
o
l
N
V(M,1)
R
o
w
M
V(M,2)
V(M,N
)
V(2,1)
R
o
w
2
V(2,2) V(2,N)
V(1,1)
R
o
w
1
V(1,2) V(1,N)
2. Regions into Tables
1. Cache into Schema
3. Key/Value into
Table Row
4. Column Types inferred
from PDX fields
Federation: Query Mapping
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
SQL for NoSQL?
‱ Extended Relational Algebra - already present in most NoSql data
‱ Relational Expression Optimization – Desirable but hard to implement
17
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Query = Relational Algebra
18
SELECT b.totalPrice, c.firstName
FROM BookOrder AS b
INNER JOIN BookCustomer AS c ON b.customerNumber = c.customerNumber
WHERE b.totalPrice > 0


}
Scan Scan
Join
Filter
Project
BookCustomer [c] BookOrder [b]
(on customerNumber)
(b.totalPrice > 0)
(c.firstName, b.totalPrice)
Scan Scan
Join
Project
BookCustomer [c] BookOrder [b]
(on
customerNumber)
(totalPrice > 0)
(c.firstName, b.totalPrice)
Project
(firstName,
customerNumber)
Filter
(totalPrice,
customerNumber)Project
<<Optimization>>
<<SQLParsing>>
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
“Native” Geode Operations
19
Relational Operation Supported on Geode
SORT/LIMIT YES (no Offset)
PROJECT YES
FILTER YES
AGGREGATE
SUM, AVG, MAX, MIN,
COUNT, GROUP BY,
DISTINCT
JOIN NO
SQL Adapter Framework
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Apache Calcite
‱ Java Framework
‱ SQL Query Parser, Validator and Optimizer(s)
‱ JDBC drivers - local and remote
‱ Agnostic to data storage and processing
‱ Powered by Calcite:
21
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Apache Geode Adapter
22
Geode API and OQL
SQL/JDBC
Convert relational expressions into OQL queriesGeode Adapter
(Geode Client)
Geode ServerGeode ServerGeode Server
Data Data Data
Push down all supported expressions to Geode OQL
and fall back to Calcite Enumerable for the rest
Enumerable
Adapter
Apache Calcite Parse SQL into relational expression and optimizes
Calcite-Geode-Embedded(e.g.JDBC.jar)
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Apache Geode Concepts
Cache Server
Cache
Region 1
Region N
ValKey
v1k1
v2k2
Cache - In-memory collection of
Regions
Region - consistent, distributed Map
(key-value),
Partitioned or Replicated
CacheServer – process
connected to the distributed
system with created Cache
ClientLocator
Client –read and modify the content
of the distributed system
Locator – tracks system members and
provides membership information


Listeners
FunctionsFunctions – distributed,
concurrent data processing
Listener – event handler.
Registers for one or more events
and notified when they occur
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Key/Value vs. OQL
“to get extreme scale we use GemFire for what it does best: key-value
storage. Then, when we can’t design our way to using what GemFire does
best, we can use OQL and treat it like an object data-base”
Mike Stolz, “Scaling Data Services with Pivotal GemFire¼”, 2018
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Query Execution Flow
25
Enumerable
Interpreter
Prepare
SQL,
Relational,
Planner
Geode
Adapter
Binder
JDBC
Geode Cluster
1
2
3
4
5
6 7
7
7
2. Parse SQL, convert to rel. expressions. Validate
and Optimize them
3. Start building a physical plan from the relation
expressions
4. Implement the Geode relations and encode
them as Expression tree
5. Pass the Expression tree to the Interpreter to
generate Java code
6. Generate and Compile a Binder instance that
on ‘bind()’ call runs Geodes’ query method
1. On new SQL query JDBC delegates to Prepare
to prepare the query execution
7. JDBC uses the newly compiled Binder to
perform the query on the Geode Cluster
Calcite Framework
Geode Adapter
2
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Query Mapping - Example
26
SELECT author
FROM BookMaster
WHERE retailCost > 0
LIMIT 1


}
SELECT author
FROM BookMaster
WHERE retailCost > 0
LIMIT 1 OFFSET 1


}
Demo
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
DB Tools Integration
28
Access Apache Geode /
GemFire over SQL/JDBC
Explore Geode & GemFire
Data with IntelliJ
SQL/Database tool
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Analytics
29
Advanced Apache
Geode Data Analytics
with Apache Zeppelin
over SQL/JDBC
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Data Federation
30
{Geode|Greenplum|...} Data Federation
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Spatial (OpenGIS /PostGIS)
31
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
SQL Stream (in progress...)
32
https://calcite.apache.org/docs/stream.html
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
SQL Stream (2)
33
● How many rows come out for each row in?
● Does each incoming value appear in one total, or more?
● What defines the “window”, the set of rows that contribute to a given output row?
● Is the result a stream or a relation?
● tumbling window (GROUP BY)
● hopping window (multi GROUP BY)
● sliding window (window functions)
● cascading window (window
functions)
Usability?
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Pros & Cons
‱ Ad-hoc data exploration
‱ JDBC integration with 3rd
party
tools
‱ Data Federation, correlate Geode
with other data sources
‱ SQL Streaming as CQ++
‱ No-intrusive and extensible
approach
‱ What happened with SQLFire?
‱ Geode == Transactional System!
SQL+Geode <> Analytical System!
‱ Key/Value vs. Full Scan
‱ Overhead: SQL > OQL > Functions
‱ Data at Rest (Table) vs. Data at
Motion (Stream)
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Future work
‱ Add Geode Adapter to Calcite Project: [CALCITE-2059] – VOTE! ;)
‱ Table Materialization
‱ SQL Streaming (https://calcite.apache.org/docs/stream.html)
‱ Pre-defined vs. Inferred Schema
‱ “Native” JOIN operation implementation
‱ Geode Indexes and Query statistics as Calcite metadata. Hint Indexes
‱ Mixing Key/Value and OQL data access
‱ Explore Geode functions as an alternative to OQL
‱ Explore TX support
‱ Performance Benchmark
‱ Calcite Spatial (https://calcite.apache.org/docs/spatial.html)
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Credits
to Dan Baskette for inspiring this work
and to Roman Shaposhnik for helping
spread the word
37
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
References
38
[1 ] Apache Geode: http://geode.apache.org
[2] Geode Object Query Language (OQL): http://bit.ly/2BfXmNR
[3] Apache Calcite: https://calcite.apache.org
[4] Calcite - supported SQL language: https://calcite.apache.org/docs/reference.html
[5] Apache Geode Adapter for Apache Calcite: https://github.com/tzolov/calcite/tree/geode-1.3
[6] Relational Algebra Operations: http://bit.ly/2zX8cMc
[7] Apache Phoenix - http://phoenix.apache.org
[8] Big Data is Four Different Problems, 2016, M.Stonebraker (video): http://bit.ly/2jDmKpq
[9] Architecture of a Database System, 2007 (J.M. Hellerstein, M. Stonebraker, J. Hamilton):
http://db.cs.berkeley.edu/papers/fntdb07-architecture.pdf
[10] One Size Fits All (Michael Stonebraker): http://ieeexplore.ieee.org/document/1410100/?denied
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons
Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Bonus: Geode Adapter Implementation
39
GeodeAdapterRel
+ implement(implContext)
GeodeAdapterConvention
Convention.Impl(“MyAdapter”)
Common interface for all MyAdapter Relation
Expressions. Provides implementation callback
method called as part of physical plan
implementation
ImplContext
+ implParm1
+ implParm2 

RelNode
GeodeAdapterTable
+ toRel(optTable)
+ asQueryable(provider,
)
GeodeAdapterQueryable
+ myQuery(params) :
Enumetator
TranslatableTable
<<instance of>>
AbstractQueryableTable
AbstractTableQueryable <<create>>
Can convert
queries in
Expression
myQuery() implements the call to your DB
It is called by the auto generated code. It must
return an Enumberable instance
GeodeAdapterScan
+ register(planer) {
Registers all MyAdapter Rules
}
<<create>>
GeodeAdapterToEnumerableConvertorRule
operands: (RelNode.class,
MyAdapterConvention, EnumerableConvention) ConverterRue
TableScan
GeodeAdapterToEnumerableConvertor
+ implement(EnumerableRelImplementor) {
ctx = new MyAdapterRel.ImplContext()
getImputs().implement(ctx)
return BlockBuild.append( MY_QUERY_REF,
Expressions.constant(ctx.implParms1),
Expressions.constant(ctx.implParms2) 

EnumerableRel
ConvertorImpl
<<create on match >>
GeodeAdapterProject
GeodeAdapterFilter
GeodeAdapterXXX
RelOptRule
GeodeAdapterProjectRu
GeodeAdapterFilterRule
GeodeAdapterXXXRule
<<create on match >>
Recursively call the implement on each MyAdapter
Relation Expression
Encode the myQuery(params) call as
Expressions
MY_QUERY_REF = Types.lookupMethod(
MyAdapterQueryable.class,
”myQuery”,
String.class
String.class);
1
3
4
5
2
6
7
8
9
Calcite Framework
GeodeAdapter components
Learn More. Stay Connected.
Vote for [CALCITE-2059] and don’t miss:
Simplifying Apache Geode with Spring Data
Exploring Data-Driven, Cognitive Capabilities in Pivotal Cloud Foundry
Orchestrating Data Microservices with Spring Cloud Data Flow
40
#springone@s1p

Mais conteĂșdo relacionado

Mais procurados

Mutant Tests Too: The SQL
Mutant Tests Too: The SQLMutant Tests Too: The SQL
Mutant Tests Too: The SQL
DataWorks Summit
 
Enterprise Java Web Application Frameworks Sample Stack Implementation
Enterprise Java Web Application Frameworks   Sample Stack ImplementationEnterprise Java Web Application Frameworks   Sample Stack Implementation
Enterprise Java Web Application Frameworks Sample Stack Implementation
Mert ÇalÄ±ĆŸkan
 
Apache Druid Auto Scale-out/in for Streaming Data Ingestion on Kubernetes
Apache Druid Auto Scale-out/in for Streaming Data Ingestion on KubernetesApache Druid Auto Scale-out/in for Streaming Data Ingestion on Kubernetes
Apache Druid Auto Scale-out/in for Streaming Data Ingestion on Kubernetes
DataWorks Summit
 

Mais procurados (20)

Self-Service Data Ingestion Using NiFi, StreamSets & Kafka
Self-Service Data Ingestion Using NiFi, StreamSets & KafkaSelf-Service Data Ingestion Using NiFi, StreamSets & Kafka
Self-Service Data Ingestion Using NiFi, StreamSets & Kafka
 
Big Data, Data Lake, Fast Data - Dataserialiation-Formats
Big Data, Data Lake, Fast Data - Dataserialiation-FormatsBig Data, Data Lake, Fast Data - Dataserialiation-Formats
Big Data, Data Lake, Fast Data - Dataserialiation-Formats
 
Solutions for bi-directional integration between Oracle RDBMS & Apache Kafka
Solutions for bi-directional integration between Oracle RDBMS & Apache KafkaSolutions for bi-directional integration between Oracle RDBMS & Apache Kafka
Solutions for bi-directional integration between Oracle RDBMS & Apache Kafka
 
Stream Processing in the Cloud With Data Microservices
Stream Processing in the Cloud With Data MicroservicesStream Processing in the Cloud With Data Microservices
Stream Processing in the Cloud With Data Microservices
 
Mutant Tests Too: The SQL
Mutant Tests Too: The SQLMutant Tests Too: The SQL
Mutant Tests Too: The SQL
 
Pci multitenancy exalogic at AMIS25
Pci multitenancy exalogic at AMIS25Pci multitenancy exalogic at AMIS25
Pci multitenancy exalogic at AMIS25
 
Java EE 8
Java EE 8Java EE 8
Java EE 8
 
How web works and browser works ? (behind the scenes)
How web works and browser works ? (behind the scenes)How web works and browser works ? (behind the scenes)
How web works and browser works ? (behind the scenes)
 
Sybase BAM Overview
Sybase BAM OverviewSybase BAM Overview
Sybase BAM Overview
 
Enterprise Java Web Application Frameworks Sample Stack Implementation
Enterprise Java Web Application Frameworks   Sample Stack ImplementationEnterprise Java Web Application Frameworks   Sample Stack Implementation
Enterprise Java Web Application Frameworks Sample Stack Implementation
 
Enterprise Application Architectures by Dr. Indika Kumara
Enterprise Application Architectures by Dr. Indika KumaraEnterprise Application Architectures by Dr. Indika Kumara
Enterprise Application Architectures by Dr. Indika Kumara
 
Migrating ETL Workflow to Apache Spark at Scale in Pinterest
Migrating ETL Workflow to Apache Spark at Scale in PinterestMigrating ETL Workflow to Apache Spark at Scale in Pinterest
Migrating ETL Workflow to Apache Spark at Scale in Pinterest
 
Solutions for bi-directional integration between Oracle RDBMS & Apache Kafka
Solutions for bi-directional integration between Oracle RDBMS & Apache KafkaSolutions for bi-directional integration between Oracle RDBMS & Apache Kafka
Solutions for bi-directional integration between Oracle RDBMS & Apache Kafka
 
Stream and Batch Processing in the Cloud with Data Microservices
Stream and Batch Processing in the Cloud with Data MicroservicesStream and Batch Processing in the Cloud with Data Microservices
Stream and Batch Processing in the Cloud with Data Microservices
 
Querying Druid in SQL with Superset
Querying Druid in SQL with SupersetQuerying Druid in SQL with Superset
Querying Druid in SQL with Superset
 
Apache Druid Auto Scale-out/in for Streaming Data Ingestion on Kubernetes
Apache Druid Auto Scale-out/in for Streaming Data Ingestion on KubernetesApache Druid Auto Scale-out/in for Streaming Data Ingestion on Kubernetes
Apache Druid Auto Scale-out/in for Streaming Data Ingestion on Kubernetes
 
Druid: Sub-Second OLAP queries over Petabytes of Streaming Data
Druid: Sub-Second OLAP queries over Petabytes of Streaming DataDruid: Sub-Second OLAP queries over Petabytes of Streaming Data
Druid: Sub-Second OLAP queries over Petabytes of Streaming Data
 
NoSQL no more: SQL on Druid with Apache Calcite
NoSQL no more: SQL on Druid with Apache CalciteNoSQL no more: SQL on Druid with Apache Calcite
NoSQL no more: SQL on Druid with Apache Calcite
 
Migrating Oracle to PostgreSQL
Migrating Oracle to PostgreSQLMigrating Oracle to PostgreSQL
Migrating Oracle to PostgreSQL
 
Modularization With Project Jigsaw in JDK 9
Modularization With Project Jigsaw in JDK 9Modularization With Project Jigsaw in JDK 9
Modularization With Project Jigsaw in JDK 9
 

Semelhante a Enable SQL/JDBC Access to Apache Geode/GemFire Using Apache Calcite

Semelhante a Enable SQL/JDBC Access to Apache Geode/GemFire Using Apache Calcite (20)

Enable SQL/JDBC Access to Apache Geode/GemFire Using Apache Calcite
Enable SQL/JDBC Access to Apache Geode/GemFire Using Apache CalciteEnable SQL/JDBC Access to Apache Geode/GemFire Using Apache Calcite
Enable SQL/JDBC Access to Apache Geode/GemFire Using Apache Calcite
 
Cloud-Native Streaming and Event-Driven Microservices
Cloud-Native Streaming and Event-Driven MicroservicesCloud-Native Streaming and Event-Driven Microservices
Cloud-Native Streaming and Event-Driven Microservices
 
SpringOnePlatform2017 recap
SpringOnePlatform2017 recapSpringOnePlatform2017 recap
SpringOnePlatform2017 recap
 
Springone2gx 2015 Cassandra and Grails
Springone2gx 2015 Cassandra and GrailsSpringone2gx 2015 Cassandra and Grails
Springone2gx 2015 Cassandra and Grails
 
Under the Hood of Reactive Data Access (2/2)
Under the Hood of Reactive Data Access (2/2)Under the Hood of Reactive Data Access (2/2)
Under the Hood of Reactive Data Access (2/2)
 
Kafka Summit NYC 2017 - Cloud Native Data Streaming Microservices with Spring...
Kafka Summit NYC 2017 - Cloud Native Data Streaming Microservices with Spring...Kafka Summit NYC 2017 - Cloud Native Data Streaming Microservices with Spring...
Kafka Summit NYC 2017 - Cloud Native Data Streaming Microservices with Spring...
 
Building Highly Scalable Spring Applications using In-Memory Data Grids
Building Highly Scalable Spring Applications using In-Memory Data GridsBuilding Highly Scalable Spring Applications using In-Memory Data Grids
Building Highly Scalable Spring Applications using In-Memory Data Grids
 
YugaByte DB—A Planet-Scale Database for Low Latency Transactional Apps
YugaByte DB—A Planet-Scale Database for Low Latency Transactional AppsYugaByte DB—A Planet-Scale Database for Low Latency Transactional Apps
YugaByte DB—A Planet-Scale Database for Low Latency Transactional Apps
 
Federated Queries with HAWQ - SQL on Hadoop and Beyond
Federated Queries with HAWQ - SQL on Hadoop and BeyondFederated Queries with HAWQ - SQL on Hadoop and Beyond
Federated Queries with HAWQ - SQL on Hadoop and Beyond
 
Simple Data Movement Patterns: Legacy Application to Cloud-Native Environment...
Simple Data Movement Patterns: Legacy Application to Cloud-Native Environment...Simple Data Movement Patterns: Legacy Application to Cloud-Native Environment...
Simple Data Movement Patterns: Legacy Application to Cloud-Native Environment...
 
Core Spring + Reactive êč€ëŻŒì„
Core Spring + Reactive  êč€ëŻŒì„Core Spring + Reactive  êč€ëŻŒì„
Core Spring + Reactive êč€ëŻŒì„
 
Lattice: A Cloud-Native Platform for Your Spring Applications
Lattice: A Cloud-Native Platform for Your Spring ApplicationsLattice: A Cloud-Native Platform for Your Spring Applications
Lattice: A Cloud-Native Platform for Your Spring Applications
 
Quickly Build Spring Boot Applications to Consume Public Cloud Services
Quickly Build Spring Boot Applications to Consume Public Cloud ServicesQuickly Build Spring Boot Applications to Consume Public Cloud Services
Quickly Build Spring Boot Applications to Consume Public Cloud Services
 
Connecting All Abstractions with Istio
Connecting All Abstractions with IstioConnecting All Abstractions with Istio
Connecting All Abstractions with Istio
 
Caching for Microservives - Introduction to Pivotal Cloud Cache
Caching for Microservives - Introduction to Pivotal Cloud CacheCaching for Microservives - Introduction to Pivotal Cloud Cache
Caching for Microservives - Introduction to Pivotal Cloud Cache
 
The Beginner’s Guide To Spring Cloud
The Beginner’s Guide To Spring CloudThe Beginner’s Guide To Spring Cloud
The Beginner’s Guide To Spring Cloud
 
Tools to Slay the Fire Breathing Monoliths in Your Enterprise
Tools to Slay the Fire Breathing Monoliths in Your EnterpriseTools to Slay the Fire Breathing Monoliths in Your Enterprise
Tools to Slay the Fire Breathing Monoliths in Your Enterprise
 
Developing Real-Time Data Pipelines with Apache Kafka
Developing Real-Time Data Pipelines with Apache KafkaDeveloping Real-Time Data Pipelines with Apache Kafka
Developing Real-Time Data Pipelines with Apache Kafka
 
It’s a Multi-Cloud World, But What About The Data?
It’s a Multi-Cloud World, But What About The Data?It’s a Multi-Cloud World, But What About The Data?
It’s a Multi-Cloud World, But What About The Data?
 
Running Java Applications on Cloud Foundry
Running Java Applications on Cloud FoundryRunning Java Applications on Cloud Foundry
Running Java Applications on Cloud Foundry
 

Mais de VMware Tanzu

Mais de VMware Tanzu (20)

What AI Means For Your Product Strategy And What To Do About It
What AI Means For Your Product Strategy And What To Do About ItWhat AI Means For Your Product Strategy And What To Do About It
What AI Means For Your Product Strategy And What To Do About It
 
Make the Right Thing the Obvious Thing at Cardinal Health 2023
Make the Right Thing the Obvious Thing at Cardinal Health 2023Make the Right Thing the Obvious Thing at Cardinal Health 2023
Make the Right Thing the Obvious Thing at Cardinal Health 2023
 
Enhancing DevEx and Simplifying Operations at Scale
Enhancing DevEx and Simplifying Operations at ScaleEnhancing DevEx and Simplifying Operations at Scale
Enhancing DevEx and Simplifying Operations at Scale
 
Spring Update | July 2023
Spring Update | July 2023Spring Update | July 2023
Spring Update | July 2023
 
Platforms, Platform Engineering, & Platform as a Product
Platforms, Platform Engineering, & Platform as a ProductPlatforms, Platform Engineering, & Platform as a Product
Platforms, Platform Engineering, & Platform as a Product
 
Building Cloud Ready Apps
Building Cloud Ready AppsBuilding Cloud Ready Apps
Building Cloud Ready Apps
 
Spring Boot 3 And Beyond
Spring Boot 3 And BeyondSpring Boot 3 And Beyond
Spring Boot 3 And Beyond
 
Spring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdf
Spring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdfSpring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdf
Spring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdf
 
Simplify and Scale Enterprise Apps in the Cloud | Boston 2023
Simplify and Scale Enterprise Apps in the Cloud | Boston 2023Simplify and Scale Enterprise Apps in the Cloud | Boston 2023
Simplify and Scale Enterprise Apps in the Cloud | Boston 2023
 
Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023
Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023
Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023
 
tanzu_developer_connect.pptx
tanzu_developer_connect.pptxtanzu_developer_connect.pptx
tanzu_developer_connect.pptx
 
Tanzu Virtual Developer Connect Workshop - French
Tanzu Virtual Developer Connect Workshop - FrenchTanzu Virtual Developer Connect Workshop - French
Tanzu Virtual Developer Connect Workshop - French
 
Tanzu Developer Connect Workshop - English
Tanzu Developer Connect Workshop - EnglishTanzu Developer Connect Workshop - English
Tanzu Developer Connect Workshop - English
 
Virtual Developer Connect Workshop - English
Virtual Developer Connect Workshop - EnglishVirtual Developer Connect Workshop - English
Virtual Developer Connect Workshop - English
 
Tanzu Developer Connect - French
Tanzu Developer Connect - FrenchTanzu Developer Connect - French
Tanzu Developer Connect - French
 
Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023
Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023
Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023
 
SpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring Boot
SpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring BootSpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring Boot
SpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring Boot
 
SpringOne Tour: The Influential Software Engineer
SpringOne Tour: The Influential Software EngineerSpringOne Tour: The Influential Software Engineer
SpringOne Tour: The Influential Software Engineer
 
SpringOne Tour: Domain-Driven Design: Theory vs Practice
SpringOne Tour: Domain-Driven Design: Theory vs PracticeSpringOne Tour: Domain-Driven Design: Theory vs Practice
SpringOne Tour: Domain-Driven Design: Theory vs Practice
 
SpringOne Tour: Spring Recipes: A Collection of Common-Sense Solutions
SpringOne Tour: Spring Recipes: A Collection of Common-Sense SolutionsSpringOne Tour: Spring Recipes: A Collection of Common-Sense Solutions
SpringOne Tour: Spring Recipes: A Collection of Common-Sense Solutions
 

Último

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Mcleodganj Call Girls đŸ„° 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls đŸ„° 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls đŸ„° 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls đŸ„° 8617370543 Service Offer VIP Hot Model
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 

Enable SQL/JDBC Access to Apache Geode/GemFire Using Apache Calcite

  • 1. Enable SQL/JDBC Access to Apache Geode/GemFire Using Apache Calcite By Christian Tzolov @christzolov 1
  • 2. Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Christian Tzolov Spring Software Engineer at Pivotal Spring Cloud Data Flow Apache Committer, Crunch PMC member Apache {Crunch, HAWQ, Zeppelin, Calcite...} 2 blog.tzolov.net @christzolov @tzolov
  • 3. Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ “What happens if an established NoSQL database decides to implement a reasonably standard SQL; The only predictable outcome for such an eventuality is plenty of argument.” Martin Fowler, P.J.Sadalage, NoSQL Distilled, 2012 3
  • 5. Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Safe Harbor Statement The following is intended to outline the general direction of Pivotal's offerings. It is intended for information purposes only and may not be incorporated into any contract. Any information regarding pre-release of Pivotal offerings, future updates or other planned modifications is subject to ongoing evaluation by Pivotal and is subject to change. This information is provided without warranty or any kind, express or implied, and is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions regarding Pivotal's offerings. These purchasing decisions should only be based on features currently available. The development, release, and timing of any features or functionality described for Pivotal's offerings in this presentation remain at the sole discretion of Pivotal. Pivotal has no obligation to update forward looking information in this presentation. 5
  • 6. Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Demo? In a minute ;) 6
  • 8. Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ 8
  • 9. Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ One Size Fit All* “The traditional DBMS architecture has been used to support many data-centric applications with widely varying characteristics and requirements
 We argue that this concept is no longer applicable to the database market, and that the commercial world will fracture into a collection of independent database engines, some of which may be unified by a common front-end parser.” Michael Stonebraker, 2005 9
  • 10. Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Collection of Independent Databases 10 How to ingest and keep consistent across DBs? How to access the data across multiple DBs?
  • 12. Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Federation: Unified Query Interface 12
  • 13. Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Federation: Two Mapping Tasks 13
  • 15. Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Geode Model Mapping ‱ PDX serialization ‱ Primitive Types ‱ Arrays (employ[0]) ‱ Nested Objects (parent[‘child.childChild
’]) 15 Cache Region 1 Region K ValKey v1k1 v2k2 Schema Table 1 Table K C o l 1 C o l 2 C o l N V(M,1) R o w M V(M,2) V(M,N ) V(2,1) R o w 2 V(2,2) V(2,N) V(1,1) R o w 1 V(1,2) V(1,N) 2. Regions into Tables 1. Cache into Schema 3. Key/Value into Table Row 4. Column Types inferred from PDX fields
  • 17. Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ SQL for NoSQL? ‱ Extended Relational Algebra - already present in most NoSql data ‱ Relational Expression Optimization – Desirable but hard to implement 17
  • 18. Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Query = Relational Algebra 18 SELECT b.totalPrice, c.firstName FROM BookOrder AS b INNER JOIN BookCustomer AS c ON b.customerNumber = c.customerNumber WHERE b.totalPrice > 0 
 } Scan Scan Join Filter Project BookCustomer [c] BookOrder [b] (on customerNumber) (b.totalPrice > 0) (c.firstName, b.totalPrice) Scan Scan Join Project BookCustomer [c] BookOrder [b] (on customerNumber) (totalPrice > 0) (c.firstName, b.totalPrice) Project (firstName, customerNumber) Filter (totalPrice, customerNumber)Project <<Optimization>> <<SQLParsing>>
  • 19. Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ “Native” Geode Operations 19 Relational Operation Supported on Geode SORT/LIMIT YES (no Offset) PROJECT YES FILTER YES AGGREGATE SUM, AVG, MAX, MIN, COUNT, GROUP BY, DISTINCT JOIN NO
  • 21. Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Apache Calcite ‱ Java Framework ‱ SQL Query Parser, Validator and Optimizer(s) ‱ JDBC drivers - local and remote ‱ Agnostic to data storage and processing ‱ Powered by Calcite: 21
  • 22. Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Apache Geode Adapter 22 Geode API and OQL SQL/JDBC Convert relational expressions into OQL queriesGeode Adapter (Geode Client) Geode ServerGeode ServerGeode Server Data Data Data Push down all supported expressions to Geode OQL and fall back to Calcite Enumerable for the rest Enumerable Adapter Apache Calcite Parse SQL into relational expression and optimizes Calcite-Geode-Embedded(e.g.JDBC.jar)
  • 23. Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Apache Geode Concepts Cache Server Cache Region 1 Region N ValKey v1k1 v2k2 Cache - In-memory collection of Regions Region - consistent, distributed Map (key-value), Partitioned or Replicated CacheServer – process connected to the distributed system with created Cache ClientLocator Client –read and modify the content of the distributed system Locator – tracks system members and provides membership information 
 Listeners FunctionsFunctions – distributed, concurrent data processing Listener – event handler. Registers for one or more events and notified when they occur
  • 24. Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Key/Value vs. OQL “to get extreme scale we use GemFire for what it does best: key-value storage. Then, when we can’t design our way to using what GemFire does best, we can use OQL and treat it like an object data-base” Mike Stolz, “Scaling Data Services with Pivotal GemFire¼”, 2018
  • 25. Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Query Execution Flow 25 Enumerable Interpreter Prepare SQL, Relational, Planner Geode Adapter Binder JDBC Geode Cluster 1 2 3 4 5 6 7 7 7 2. Parse SQL, convert to rel. expressions. Validate and Optimize them 3. Start building a physical plan from the relation expressions 4. Implement the Geode relations and encode them as Expression tree 5. Pass the Expression tree to the Interpreter to generate Java code 6. Generate and Compile a Binder instance that on ‘bind()’ call runs Geodes’ query method 1. On new SQL query JDBC delegates to Prepare to prepare the query execution 7. JDBC uses the newly compiled Binder to perform the query on the Geode Cluster Calcite Framework Geode Adapter 2
  • 26. Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Query Mapping - Example 26 SELECT author FROM BookMaster WHERE retailCost > 0 LIMIT 1 
 } SELECT author FROM BookMaster WHERE retailCost > 0 LIMIT 1 OFFSET 1 
 }
  • 27. Demo
  • 28. Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ DB Tools Integration 28 Access Apache Geode / GemFire over SQL/JDBC Explore Geode & GemFire Data with IntelliJ SQL/Database tool
  • 29. Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Analytics 29 Advanced Apache Geode Data Analytics with Apache Zeppelin over SQL/JDBC
  • 30. Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Data Federation 30 {Geode|Greenplum|...} Data Federation
  • 31. Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Spatial (OpenGIS /PostGIS) 31
  • 32. Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ SQL Stream (in progress...) 32 https://calcite.apache.org/docs/stream.html
  • 33. Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ SQL Stream (2) 33 ● How many rows come out for each row in? ● Does each incoming value appear in one total, or more? ● What defines the “window”, the set of rows that contribute to a given output row? ● Is the result a stream or a relation? ● tumbling window (GROUP BY) ● hopping window (multi GROUP BY) ● sliding window (window functions) ● cascading window (window functions)
  • 35. Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Pros & Cons ‱ Ad-hoc data exploration ‱ JDBC integration with 3rd party tools ‱ Data Federation, correlate Geode with other data sources ‱ SQL Streaming as CQ++ ‱ No-intrusive and extensible approach ‱ What happened with SQLFire? ‱ Geode == Transactional System! SQL+Geode <> Analytical System! ‱ Key/Value vs. Full Scan ‱ Overhead: SQL > OQL > Functions ‱ Data at Rest (Table) vs. Data at Motion (Stream)
  • 36. Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Future work ‱ Add Geode Adapter to Calcite Project: [CALCITE-2059] – VOTE! ;) ‱ Table Materialization ‱ SQL Streaming (https://calcite.apache.org/docs/stream.html) ‱ Pre-defined vs. Inferred Schema ‱ “Native” JOIN operation implementation ‱ Geode Indexes and Query statistics as Calcite metadata. Hint Indexes ‱ Mixing Key/Value and OQL data access ‱ Explore Geode functions as an alternative to OQL ‱ Explore TX support ‱ Performance Benchmark ‱ Calcite Spatial (https://calcite.apache.org/docs/spatial.html)
  • 37. Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Credits to Dan Baskette for inspiring this work and to Roman Shaposhnik for helping spread the word 37
  • 38. Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ References 38 [1 ] Apache Geode: http://geode.apache.org [2] Geode Object Query Language (OQL): http://bit.ly/2BfXmNR [3] Apache Calcite: https://calcite.apache.org [4] Calcite - supported SQL language: https://calcite.apache.org/docs/reference.html [5] Apache Geode Adapter for Apache Calcite: https://github.com/tzolov/calcite/tree/geode-1.3 [6] Relational Algebra Operations: http://bit.ly/2zX8cMc [7] Apache Phoenix - http://phoenix.apache.org [8] Big Data is Four Different Problems, 2016, M.Stonebraker (video): http://bit.ly/2jDmKpq [9] Architecture of a Database System, 2007 (J.M. Hellerstein, M. Stonebraker, J. Hamilton): http://db.cs.berkeley.edu/papers/fntdb07-architecture.pdf [10] One Size Fits All (Michael Stonebraker): http://ieeexplore.ieee.org/document/1410100/?denied
  • 39. Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Bonus: Geode Adapter Implementation 39 GeodeAdapterRel + implement(implContext) GeodeAdapterConvention Convention.Impl(“MyAdapter”) Common interface for all MyAdapter Relation Expressions. Provides implementation callback method called as part of physical plan implementation ImplContext + implParm1 + implParm2 
 RelNode GeodeAdapterTable + toRel(optTable) + asQueryable(provider,
) GeodeAdapterQueryable + myQuery(params) : Enumetator TranslatableTable <<instance of>> AbstractQueryableTable AbstractTableQueryable <<create>> Can convert queries in Expression myQuery() implements the call to your DB It is called by the auto generated code. It must return an Enumberable instance GeodeAdapterScan + register(planer) { Registers all MyAdapter Rules } <<create>> GeodeAdapterToEnumerableConvertorRule operands: (RelNode.class, MyAdapterConvention, EnumerableConvention) ConverterRue TableScan GeodeAdapterToEnumerableConvertor + implement(EnumerableRelImplementor) { ctx = new MyAdapterRel.ImplContext() getImputs().implement(ctx) return BlockBuild.append( MY_QUERY_REF, Expressions.constant(ctx.implParms1), Expressions.constant(ctx.implParms2) 
 EnumerableRel ConvertorImpl <<create on match >> GeodeAdapterProject GeodeAdapterFilter GeodeAdapterXXX RelOptRule GeodeAdapterProjectRu GeodeAdapterFilterRule GeodeAdapterXXXRule <<create on match >> Recursively call the implement on each MyAdapter Relation Expression Encode the myQuery(params) call as Expressions MY_QUERY_REF = Types.lookupMethod( MyAdapterQueryable.class, ”myQuery”, String.class String.class); 1 3 4 5 2 6 7 8 9 Calcite Framework GeodeAdapter components
  • 40. Learn More. Stay Connected. Vote for [CALCITE-2059] and don’t miss: Simplifying Apache Geode with Spring Data Exploring Data-Driven, Cognitive Capabilities in Pivotal Cloud Foundry Orchestrating Data Microservices with Spring Cloud Data Flow 40 #springone@s1p