SlideShare a Scribd company logo
Coimbra, April 18th, 2012




                                 Sanne Grinovero
                            Hibernate Team, JBoss
                                      Red Hat, Inc
About me
• Hibernate           in.relation.to/Bloggers/Sanne
 • Hibernate Search
 • Hibernate OGM
                      Twitter: @SanneGrinovero
• Infinispan
 • Lucene Directory
 • Infinispan Query   Studied at FEUP (Porto)!
Hibernate Object/Grid Mapper ?

         JPA for NoSQL

     • initially Key/Value store
     • we started with Infinispan
Relational Databases
           • Transactions
           • Referential integrity
           • Simple Types
           • Well understood
            - tuning, backup,
            resilience
Relational Databases
  But scaling is hard!
  -Replication
  -Multiple instances w/ shared
   disk
  -Sharding
Relational Databases on a cloud
Master/replicas: which master?

A single master? I was promised elasticity

Less reliable “disks”

IP in configuration files? DNS update times?

Who coordinates this? How does that failover?
¬SQL

more meaning NotOnlySQL

 ¬SQL U SQL = anything
No-SQL goals
Very heterogeneus
• Large datasets
• High availability
• Low latency / higher throughput
• Specific data access pattern
• Specific data structures
• ...
NotOnlySQL
• Document based stores
• Column based
• Graph oriented databases
• Key / value stores
• Full-Text Search
NotOnlySQL

Choose one.
          Before starting.
                         Stick to it.
Flexibility at a cost

• Programming model
  • one per product :-(
  • Often very thight code coupling
  • No standard drivers / stable APIs
• no schema => app driven schema
• query (Map Reduce, specific DSL, ...)
• data structure transpires
• Transactions ?
• durability / consistency puzzles
Where does Infinispan fit?
Distributed Key/Value store
      • (or Replicated, local only efficient cache,
      invalidating cache)
 Each node is equal
      • Just start more nodes, or kill some
 No bottlenecks
      • by design
 Cloud-network friendly
      • JGroups
      • And “cloud storage” friendly too!
But how to use it?

map.put( “user-34”, userInstance );

map.get( “user-34” );

map.remove( “user-34” );
It's a ConcurrentMap !

map.put( “user-34”, userInstance );

map.get( “user-34” );

map.remove( “user-34” );

map.putIfAbsent( “user-38”, another );
Other Hibernate/Infinispan
      collaborations

●
    Second level cache for Hibernate ORM

●
    Hibernate Search indexing backend

●
    Infinispan Query
Cloud-hack experiments
Let's play with Infinispan's integration for
Hibernate's second level cache design:
 - usually configured in clustering mode
 INVALIDATION.
      •Let's use DIST or REPL instead.
 - Disable expiry/timeouts.

 What's the effect on your cloud-deployed
 database?
Cloud-hack experiments

Now introduce Hibernate Search:
 - full-text queries should be handled by
Lucene, NOT by the database.

Hibernate Search identifies hits from the
Lucene index, but loads them by PK. *by default
What's the work left to the database?
These tools are very
   appropriate for the job:
Load by PK ->
      second level cache ->
           Key/Value store

FullText query ->
       Hibernate Search ->
            Lucene Indexes
These tools are very
   appropriate for the job:
Load by PK ->
      second level cache ->
           Key/Value store

FullText query ->
       Hibernate Search ->
            Lucene Indexes

 What if we now shut down the database?
Goals

•   Encourage new data usage patterns
•   Familiar environment
•   Ease of use
•   Easy to jump in
•   Easy to jump out
•   Push NoSQL exploration in enterprises
•   “PaaS for existing API” initiative
What it does

• JPA front end to key/value stores
  • Object CRUD (incl polymorphism and associations)
  • OO queries (JP-QL)
• Reuses
  • Hibernate Core
  • Hibernate Search (and Lucene)
  • Infinispan
• Is not a silver bullet
  • not for all NoSQL use cases
Concepts
Schema or no schema?

• Schema-less
  • move to new schema very easy
  • app deal with old and new structure or migrate all
    data
  • need strict development guidelines
• Schema
  • reduce likelihood of rogue developer corruption
  • share with other apps
  • “didn’t think about that” bugs reduced
Entities as serialized blobs?
• Serialize objects into the (key) value
  • store the whole graph?

• maintain consistency with duplicated objects
  • guaranteed identity a == b
  • concurrency / latency
  • structure change and (de)serialization, class definition
    changes
OGM’s approach to schema


• Keep what’s best from relational model
  • as much as possible
  • tables / columns / pks
• Decorrelate object structure from data structure
• Data stored as (self-described) tuples
• Core types limited
  • portability
OGM’s approach to schema



• Store metadata for queries
  • Lucene index
• CRUD operations are key lookups
How does it work?
• Entities are stored as tuples (Map<String,Object>)
  • Or Documents?
• The key is composed of
  • table name
  • entity id
• Collections are represented as a list of tuples
- The key is composed of:
    • table name hosting the collection information
    • column names representing the FK
    • column values representing the FK
Let's see some code...
Queries / Infinispan

• Hibernate Search indexes entities
• Store Lucene indexes in Infinispan
• JP-QL to Lucene query transformation

• Works for simple queries
  • Lucene is not a relational SQL engine
select a from Animal a where a.size > 20

> animalQueryBuilder
.range().onField(“size”).above(20).excludeLimit()
.createQuery();

select u from Order o join o.user u where o.price > 100 and u.city =
“Paris”
> orderQB.bool()
  .must(
    orderQB.range()
        .onField(“price”).above(100).excludeLimit().createQuery() )
  .must(
    orderQB.keyword(“user.city”).matching(“Paris”)
    .createQuery()
).createQuery();
Why Infinispan?

• We know it well
• Supports transactions
• Supports distribution of Lucene indexes
• Designed for clouds
• It's a key/value store with support for Map/Reduce
  • Simple
  • Likely a common point for many other “databases”
Why Infinispan?

•Map/Reduce as an alternative to
 indexed queries
 •Might be chosen by a clever JP-QL
  engine
•Potential for additional query types
Why ?
Nothing new to learn for most common operations:
• JPA models
• JP-QL queries

Everything else is performance tuning, including:
• Move to/from different NoSQL implementations
• Move to/from a SQL implementation
• Move to/from clouds/laptops
• JPA is a well known standard: move to/from
 Hibernate :-)
Development state:
  • Query via Hibernate Search
    • Smart JP-QL parser is on github

  • Available in master:
    • EHCache
    • Infinispan
  • In development branches:
    • MongoDB
    • Voldemort
Summary


• Performance / scalability is different
• Isolation is different
http://ogm.hibernate.org
http://www.jboss.org/jbw2011keynote.html
   https://github.com/Sanne/tweets-ogm
Q+A

More Related Content

What's hot

Scala profiling
Scala profilingScala profiling
Scala profiling
Filippo Pacifici
 
ORM, JPA, & Hibernate Overview
ORM, JPA, & Hibernate OverviewORM, JPA, & Hibernate Overview
ORM, JPA, & Hibernate OverviewBrett Meyer
 
Scala and Spark are Ideal for Big Data
Scala and Spark are Ideal for Big DataScala and Spark are Ideal for Big Data
Scala and Spark are Ideal for Big Data
John Nestor
 
H-Hypermap - Heatmap Analytics at Scale: Presented by David Smiley, D W Smile...
H-Hypermap - Heatmap Analytics at Scale: Presented by David Smiley, D W Smile...H-Hypermap - Heatmap Analytics at Scale: Presented by David Smiley, D W Smile...
H-Hypermap - Heatmap Analytics at Scale: Presented by David Smiley, D W Smile...
Lucidworks
 
Introduction to Machine Learning for Oracle Database Professionals
Introduction to Machine Learning for Oracle Database ProfessionalsIntroduction to Machine Learning for Oracle Database Professionals
Introduction to Machine Learning for Oracle Database Professionals
Alex Gorbachev
 
Dev nexus 2017
Dev nexus 2017Dev nexus 2017
Dev nexus 2017
Roy Russo
 
Devnexus 2018
Devnexus 2018Devnexus 2018
Devnexus 2018
Roy Russo
 
Lessons From Sharding Solr At Etsy: Presented by Gregg Donovan, Etsy
Lessons From Sharding Solr At Etsy: Presented by Gregg Donovan, EtsyLessons From Sharding Solr At Etsy: Presented by Gregg Donovan, Etsy
Lessons From Sharding Solr At Etsy: Presented by Gregg Donovan, Etsy
Lucidworks
 
Under The Hood of Pluggable Databases by Alex Gorbachev, Pythian, Oracle OpeW...
Under The Hood of Pluggable Databases by Alex Gorbachev, Pythian, Oracle OpeW...Under The Hood of Pluggable Databases by Alex Gorbachev, Pythian, Oracle OpeW...
Under The Hood of Pluggable Databases by Alex Gorbachev, Pythian, Oracle OpeW...
Alex Gorbachev
 
Scala and Spark are Ideal for Big Data - Data Science Pop-up Seattle
Scala and Spark are Ideal for Big Data - Data Science Pop-up SeattleScala and Spark are Ideal for Big Data - Data Science Pop-up Seattle
Scala and Spark are Ideal for Big Data - Data Science Pop-up Seattle
Domino Data Lab
 
Building a Large Scale SEO/SEM Application with Apache Solr
Building a Large Scale SEO/SEM Application with Apache SolrBuilding a Large Scale SEO/SEM Application with Apache Solr
Building a Large Scale SEO/SEM Application with Apache Solr
Rahul Jain
 
Searching The Enterprise Data Lake With Solr - Watch Us Do It!: Presented by...
Searching The Enterprise Data Lake With Solr  - Watch Us Do It!: Presented by...Searching The Enterprise Data Lake With Solr  - Watch Us Do It!: Presented by...
Searching The Enterprise Data Lake With Solr - Watch Us Do It!: Presented by...
Lucidworks
 
Not Just ORM: Powerful Hibernate ORM Features and Capabilities
Not Just ORM: Powerful Hibernate ORM Features and CapabilitiesNot Just ORM: Powerful Hibernate ORM Features and Capabilities
Not Just ORM: Powerful Hibernate ORM Features and Capabilities
Brett Meyer
 
Scaling MySQL using Fabric
Scaling MySQL using FabricScaling MySQL using Fabric
Scaling MySQL using Fabric
Karthik .P.R
 
Case study of Rujhaan.com (A social news app )
Case study of Rujhaan.com (A social news app )Case study of Rujhaan.com (A social news app )
Case study of Rujhaan.com (A social news app )
Rahul Jain
 
Apache Content Technologies
Apache Content TechnologiesApache Content Technologies
Apache Content Technologies
gagravarr
 
Hibernate ORM: Tips, Tricks, and Performance Techniques
Hibernate ORM: Tips, Tricks, and Performance TechniquesHibernate ORM: Tips, Tricks, and Performance Techniques
Hibernate ORM: Tips, Tricks, and Performance Techniques
Brett Meyer
 
Solr + Hadoop = Big Data Search
Solr + Hadoop = Big Data SearchSolr + Hadoop = Big Data Search
Solr + Hadoop = Big Data SearchMark Miller
 
Never Stop Exploring - Pushing the Limits of Solr: Presented by Anirudha Jadh...
Never Stop Exploring - Pushing the Limits of Solr: Presented by Anirudha Jadh...Never Stop Exploring - Pushing the Limits of Solr: Presented by Anirudha Jadh...
Never Stop Exploring - Pushing the Limits of Solr: Presented by Anirudha Jadh...
Lucidworks
 
Divide and conquer in the cloud
Divide and conquer in the cloudDivide and conquer in the cloud
Divide and conquer in the cloud
Justin Swanhart
 

What's hot (20)

Scala profiling
Scala profilingScala profiling
Scala profiling
 
ORM, JPA, & Hibernate Overview
ORM, JPA, & Hibernate OverviewORM, JPA, & Hibernate Overview
ORM, JPA, & Hibernate Overview
 
Scala and Spark are Ideal for Big Data
Scala and Spark are Ideal for Big DataScala and Spark are Ideal for Big Data
Scala and Spark are Ideal for Big Data
 
H-Hypermap - Heatmap Analytics at Scale: Presented by David Smiley, D W Smile...
H-Hypermap - Heatmap Analytics at Scale: Presented by David Smiley, D W Smile...H-Hypermap - Heatmap Analytics at Scale: Presented by David Smiley, D W Smile...
H-Hypermap - Heatmap Analytics at Scale: Presented by David Smiley, D W Smile...
 
Introduction to Machine Learning for Oracle Database Professionals
Introduction to Machine Learning for Oracle Database ProfessionalsIntroduction to Machine Learning for Oracle Database Professionals
Introduction to Machine Learning for Oracle Database Professionals
 
Dev nexus 2017
Dev nexus 2017Dev nexus 2017
Dev nexus 2017
 
Devnexus 2018
Devnexus 2018Devnexus 2018
Devnexus 2018
 
Lessons From Sharding Solr At Etsy: Presented by Gregg Donovan, Etsy
Lessons From Sharding Solr At Etsy: Presented by Gregg Donovan, EtsyLessons From Sharding Solr At Etsy: Presented by Gregg Donovan, Etsy
Lessons From Sharding Solr At Etsy: Presented by Gregg Donovan, Etsy
 
Under The Hood of Pluggable Databases by Alex Gorbachev, Pythian, Oracle OpeW...
Under The Hood of Pluggable Databases by Alex Gorbachev, Pythian, Oracle OpeW...Under The Hood of Pluggable Databases by Alex Gorbachev, Pythian, Oracle OpeW...
Under The Hood of Pluggable Databases by Alex Gorbachev, Pythian, Oracle OpeW...
 
Scala and Spark are Ideal for Big Data - Data Science Pop-up Seattle
Scala and Spark are Ideal for Big Data - Data Science Pop-up SeattleScala and Spark are Ideal for Big Data - Data Science Pop-up Seattle
Scala and Spark are Ideal for Big Data - Data Science Pop-up Seattle
 
Building a Large Scale SEO/SEM Application with Apache Solr
Building a Large Scale SEO/SEM Application with Apache SolrBuilding a Large Scale SEO/SEM Application with Apache Solr
Building a Large Scale SEO/SEM Application with Apache Solr
 
Searching The Enterprise Data Lake With Solr - Watch Us Do It!: Presented by...
Searching The Enterprise Data Lake With Solr  - Watch Us Do It!: Presented by...Searching The Enterprise Data Lake With Solr  - Watch Us Do It!: Presented by...
Searching The Enterprise Data Lake With Solr - Watch Us Do It!: Presented by...
 
Not Just ORM: Powerful Hibernate ORM Features and Capabilities
Not Just ORM: Powerful Hibernate ORM Features and CapabilitiesNot Just ORM: Powerful Hibernate ORM Features and Capabilities
Not Just ORM: Powerful Hibernate ORM Features and Capabilities
 
Scaling MySQL using Fabric
Scaling MySQL using FabricScaling MySQL using Fabric
Scaling MySQL using Fabric
 
Case study of Rujhaan.com (A social news app )
Case study of Rujhaan.com (A social news app )Case study of Rujhaan.com (A social news app )
Case study of Rujhaan.com (A social news app )
 
Apache Content Technologies
Apache Content TechnologiesApache Content Technologies
Apache Content Technologies
 
Hibernate ORM: Tips, Tricks, and Performance Techniques
Hibernate ORM: Tips, Tricks, and Performance TechniquesHibernate ORM: Tips, Tricks, and Performance Techniques
Hibernate ORM: Tips, Tricks, and Performance Techniques
 
Solr + Hadoop = Big Data Search
Solr + Hadoop = Big Data SearchSolr + Hadoop = Big Data Search
Solr + Hadoop = Big Data Search
 
Never Stop Exploring - Pushing the Limits of Solr: Presented by Anirudha Jadh...
Never Stop Exploring - Pushing the Limits of Solr: Presented by Anirudha Jadh...Never Stop Exploring - Pushing the Limits of Solr: Presented by Anirudha Jadh...
Never Stop Exploring - Pushing the Limits of Solr: Presented by Anirudha Jadh...
 
Divide and conquer in the cloud
Divide and conquer in the cloudDivide and conquer in the cloud
Divide and conquer in the cloud
 

Viewers also liked

Microservices
MicroservicesMicroservices
Microservices
PT.JUG
 
JBoss Brings More Power to your Business Processes (PTJUG)
JBoss Brings More Power to your Business Processes (PTJUG)JBoss Brings More Power to your Business Processes (PTJUG)
JBoss Brings More Power to your Business Processes (PTJUG)
Eric D. Schabell
 
metrics - performance monitoring or business value optimization?
metrics - performance monitoring or business value optimization?metrics - performance monitoring or business value optimization?
metrics - performance monitoring or business value optimization?
João Nelas
 
MySQL
MySQLMySQL
MySQL
PT.JUG
 
An Introduction to Play 2 Framework
An Introduction to Play 2 FrameworkAn Introduction to Play 2 Framework
An Introduction to Play 2 Framework
PT.JUG
 
Apache Camel
Apache CamelApache Camel
Apache Camel
PT.JUG
 
JMockit & Hamcrest
JMockit & HamcrestJMockit & Hamcrest
JMockit & Hamcrest
PT.JUG
 
What's Coming in Java EE 8
What's Coming in Java EE 8What's Coming in Java EE 8
What's Coming in Java EE 8
PT.JUG
 
Introducing Java 8
Introducing Java 8Introducing Java 8
Introducing Java 8
PT.JUG
 
An OpenShift Primer for Developers to get your Code into the Cloud (PTJUG)
An OpenShift Primer for Developers to get your Code into the Cloud (PTJUG)An OpenShift Primer for Developers to get your Code into the Cloud (PTJUG)
An OpenShift Primer for Developers to get your Code into the Cloud (PTJUG)
Eric D. Schabell
 
What's new in the MongoDB Java Driver (2.5)?
What's new in the MongoDB Java Driver (2.5)?What's new in the MongoDB Java Driver (2.5)?
What's new in the MongoDB Java Driver (2.5)?
Scott Hernandez
 
Java Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDBJava Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDB
Tobias Trelle
 
Java driver for mongo db
Java driver for mongo dbJava driver for mongo db
Java driver for mongo db
Abhay Pai
 
Introducing Hibernate OGM: porting JPA applications to NoSQL, Sanne Grinovero...
Introducing Hibernate OGM: porting JPA applications to NoSQL, Sanne Grinovero...Introducing Hibernate OGM: porting JPA applications to NoSQL, Sanne Grinovero...
Introducing Hibernate OGM: porting JPA applications to NoSQL, Sanne Grinovero...OpenBlend society
 
Mongo sf easy java persistence
Mongo sf   easy java persistenceMongo sf   easy java persistence
Mongo sf easy java persistenceScott Hernandez
 
Introducing Infinispan
Introducing InfinispanIntroducing Infinispan
Introducing Infinispan
PT.JUG
 
Java development with MongoDB
Java development with MongoDBJava development with MongoDB
Java development with MongoDB
James Williams
 
Get expertise with mongo db
Get expertise with mongo dbGet expertise with mongo db
Get expertise with mongo db
Amit Thakkar
 
CDI: How do I ?
CDI: How do I ?CDI: How do I ?
CDI: How do I ?
Antonio Goncalves
 
50 new features of Java EE 7 in 50 minutes
50 new features of Java EE 7 in 50 minutes50 new features of Java EE 7 in 50 minutes
50 new features of Java EE 7 in 50 minutes
Antonio Goncalves
 

Viewers also liked (20)

Microservices
MicroservicesMicroservices
Microservices
 
JBoss Brings More Power to your Business Processes (PTJUG)
JBoss Brings More Power to your Business Processes (PTJUG)JBoss Brings More Power to your Business Processes (PTJUG)
JBoss Brings More Power to your Business Processes (PTJUG)
 
metrics - performance monitoring or business value optimization?
metrics - performance monitoring or business value optimization?metrics - performance monitoring or business value optimization?
metrics - performance monitoring or business value optimization?
 
MySQL
MySQLMySQL
MySQL
 
An Introduction to Play 2 Framework
An Introduction to Play 2 FrameworkAn Introduction to Play 2 Framework
An Introduction to Play 2 Framework
 
Apache Camel
Apache CamelApache Camel
Apache Camel
 
JMockit & Hamcrest
JMockit & HamcrestJMockit & Hamcrest
JMockit & Hamcrest
 
What's Coming in Java EE 8
What's Coming in Java EE 8What's Coming in Java EE 8
What's Coming in Java EE 8
 
Introducing Java 8
Introducing Java 8Introducing Java 8
Introducing Java 8
 
An OpenShift Primer for Developers to get your Code into the Cloud (PTJUG)
An OpenShift Primer for Developers to get your Code into the Cloud (PTJUG)An OpenShift Primer for Developers to get your Code into the Cloud (PTJUG)
An OpenShift Primer for Developers to get your Code into the Cloud (PTJUG)
 
What's new in the MongoDB Java Driver (2.5)?
What's new in the MongoDB Java Driver (2.5)?What's new in the MongoDB Java Driver (2.5)?
What's new in the MongoDB Java Driver (2.5)?
 
Java Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDBJava Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDB
 
Java driver for mongo db
Java driver for mongo dbJava driver for mongo db
Java driver for mongo db
 
Introducing Hibernate OGM: porting JPA applications to NoSQL, Sanne Grinovero...
Introducing Hibernate OGM: porting JPA applications to NoSQL, Sanne Grinovero...Introducing Hibernate OGM: porting JPA applications to NoSQL, Sanne Grinovero...
Introducing Hibernate OGM: porting JPA applications to NoSQL, Sanne Grinovero...
 
Mongo sf easy java persistence
Mongo sf   easy java persistenceMongo sf   easy java persistence
Mongo sf easy java persistence
 
Introducing Infinispan
Introducing InfinispanIntroducing Infinispan
Introducing Infinispan
 
Java development with MongoDB
Java development with MongoDBJava development with MongoDB
Java development with MongoDB
 
Get expertise with mongo db
Get expertise with mongo dbGet expertise with mongo db
Get expertise with mongo db
 
CDI: How do I ?
CDI: How do I ?CDI: How do I ?
CDI: How do I ?
 
50 new features of Java EE 7 in 50 minutes
50 new features of Java EE 7 in 50 minutes50 new features of Java EE 7 in 50 minutes
50 new features of Java EE 7 in 50 minutes
 

Similar to Using JPA applications in the era of NoSQL: Introducing Hibernate OGM

Data Modeling for NoSQL
Data Modeling for NoSQLData Modeling for NoSQL
Data Modeling for NoSQL
Tony Tam
 
RavenDB in the wild
RavenDB in the wildRavenDB in the wild
RavenDB in the wild
Mauro Servienti
 
SeaJUG May 2012 mybatis
SeaJUG May 2012 mybatisSeaJUG May 2012 mybatis
SeaJUG May 2012 mybatisWill Iverson
 
Kylin and Druid Presentation
Kylin and Druid PresentationKylin and Druid Presentation
Kylin and Druid Presentation
argonauts007
 
Impala Architecture presentation
Impala Architecture presentationImpala Architecture presentation
Impala Architecture presentation
hadooparchbook
 
Writing Scalable Software in Java
Writing Scalable Software in JavaWriting Scalable Software in Java
Writing Scalable Software in Java
Ruben Badaró
 
Why we love ArangoDB. The hunt for the right NosQL Database
Why we love ArangoDB. The hunt for the right NosQL DatabaseWhy we love ArangoDB. The hunt for the right NosQL Database
Why we love ArangoDB. The hunt for the right NosQL Database
Andreas Jung
 
Giraph+Gora in ApacheCon14
Giraph+Gora in ApacheCon14Giraph+Gora in ApacheCon14
Giraph+Gora in ApacheCon14
Renato Javier Marroquín Mogrovejo
 
Scalability, Availability & Stability Patterns
Scalability, Availability & Stability PatternsScalability, Availability & Stability Patterns
Scalability, Availability & Stability Patterns
Jonas Bonér
 
hibernateormfeatures-140223193044-phpapp02.pdf
hibernateormfeatures-140223193044-phpapp02.pdfhibernateormfeatures-140223193044-phpapp02.pdf
hibernateormfeatures-140223193044-phpapp02.pdf
Patiento Del Mar
 
Data Science at Scale: Using Apache Spark for Data Science at Bitly
Data Science at Scale: Using Apache Spark for Data Science at BitlyData Science at Scale: Using Apache Spark for Data Science at Bitly
Data Science at Scale: Using Apache Spark for Data Science at Bitly
Sarah Guido
 
Microsoft Openness Mongo DB
Microsoft Openness Mongo DBMicrosoft Openness Mongo DB
Microsoft Openness Mongo DBHeriyadi Janwar
 
Big Data! Great! Now What? #SymfonyCon 2014
Big Data! Great! Now What? #SymfonyCon 2014Big Data! Great! Now What? #SymfonyCon 2014
Big Data! Great! Now What? #SymfonyCon 2014
Ricard Clau
 
2014-10-20 Large-Scale Machine Learning with Apache Spark at Internet of Thin...
2014-10-20 Large-Scale Machine Learning with Apache Spark at Internet of Thin...2014-10-20 Large-Scale Machine Learning with Apache Spark at Internet of Thin...
2014-10-20 Large-Scale Machine Learning with Apache Spark at Internet of Thin...
DB Tsai
 
Presto Summit 2018 - 02 - LinkedIn
Presto Summit 2018  - 02 - LinkedInPresto Summit 2018  - 02 - LinkedIn
Presto Summit 2018 - 02 - LinkedIn
kbajda
 
Why Functional Programming Is Important in Big Data Era
Why Functional Programming Is Important in Big Data EraWhy Functional Programming Is Important in Big Data Era
Why Functional Programming Is Important in Big Data Era
Handaru Sakti
 
Workflow Engines for Hadoop
Workflow Engines for HadoopWorkflow Engines for Hadoop
Workflow Engines for Hadoop
Joe Crobak
 
Apache Spark Fundamentals
Apache Spark FundamentalsApache Spark Fundamentals
Apache Spark Fundamentals
Zahra Eskandari
 
A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?
A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?
A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?DATAVERSITY
 
Deep Learning on Apache® Spark™: Workflows and Best Practices
Deep Learning on Apache® Spark™: Workflows and Best PracticesDeep Learning on Apache® Spark™: Workflows and Best Practices
Deep Learning on Apache® Spark™: Workflows and Best Practices
Databricks
 

Similar to Using JPA applications in the era of NoSQL: Introducing Hibernate OGM (20)

Data Modeling for NoSQL
Data Modeling for NoSQLData Modeling for NoSQL
Data Modeling for NoSQL
 
RavenDB in the wild
RavenDB in the wildRavenDB in the wild
RavenDB in the wild
 
SeaJUG May 2012 mybatis
SeaJUG May 2012 mybatisSeaJUG May 2012 mybatis
SeaJUG May 2012 mybatis
 
Kylin and Druid Presentation
Kylin and Druid PresentationKylin and Druid Presentation
Kylin and Druid Presentation
 
Impala Architecture presentation
Impala Architecture presentationImpala Architecture presentation
Impala Architecture presentation
 
Writing Scalable Software in Java
Writing Scalable Software in JavaWriting Scalable Software in Java
Writing Scalable Software in Java
 
Why we love ArangoDB. The hunt for the right NosQL Database
Why we love ArangoDB. The hunt for the right NosQL DatabaseWhy we love ArangoDB. The hunt for the right NosQL Database
Why we love ArangoDB. The hunt for the right NosQL Database
 
Giraph+Gora in ApacheCon14
Giraph+Gora in ApacheCon14Giraph+Gora in ApacheCon14
Giraph+Gora in ApacheCon14
 
Scalability, Availability & Stability Patterns
Scalability, Availability & Stability PatternsScalability, Availability & Stability Patterns
Scalability, Availability & Stability Patterns
 
hibernateormfeatures-140223193044-phpapp02.pdf
hibernateormfeatures-140223193044-phpapp02.pdfhibernateormfeatures-140223193044-phpapp02.pdf
hibernateormfeatures-140223193044-phpapp02.pdf
 
Data Science at Scale: Using Apache Spark for Data Science at Bitly
Data Science at Scale: Using Apache Spark for Data Science at BitlyData Science at Scale: Using Apache Spark for Data Science at Bitly
Data Science at Scale: Using Apache Spark for Data Science at Bitly
 
Microsoft Openness Mongo DB
Microsoft Openness Mongo DBMicrosoft Openness Mongo DB
Microsoft Openness Mongo DB
 
Big Data! Great! Now What? #SymfonyCon 2014
Big Data! Great! Now What? #SymfonyCon 2014Big Data! Great! Now What? #SymfonyCon 2014
Big Data! Great! Now What? #SymfonyCon 2014
 
2014-10-20 Large-Scale Machine Learning with Apache Spark at Internet of Thin...
2014-10-20 Large-Scale Machine Learning with Apache Spark at Internet of Thin...2014-10-20 Large-Scale Machine Learning with Apache Spark at Internet of Thin...
2014-10-20 Large-Scale Machine Learning with Apache Spark at Internet of Thin...
 
Presto Summit 2018 - 02 - LinkedIn
Presto Summit 2018  - 02 - LinkedInPresto Summit 2018  - 02 - LinkedIn
Presto Summit 2018 - 02 - LinkedIn
 
Why Functional Programming Is Important in Big Data Era
Why Functional Programming Is Important in Big Data EraWhy Functional Programming Is Important in Big Data Era
Why Functional Programming Is Important in Big Data Era
 
Workflow Engines for Hadoop
Workflow Engines for HadoopWorkflow Engines for Hadoop
Workflow Engines for Hadoop
 
Apache Spark Fundamentals
Apache Spark FundamentalsApache Spark Fundamentals
Apache Spark Fundamentals
 
A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?
A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?
A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?
 
Deep Learning on Apache® Spark™: Workflows and Best Practices
Deep Learning on Apache® Spark™: Workflows and Best PracticesDeep Learning on Apache® Spark™: Workflows and Best Practices
Deep Learning on Apache® Spark™: Workflows and Best Practices
 

More from PT.JUG

Overview of Eclipse technologies
Overview of Eclipse technologiesOverview of Eclipse technologies
Overview of Eclipse technologies
PT.JUG
 
Putting Hypermedia Back in REST with JAX-RS
Putting Hypermedia Back in REST with JAX-RSPutting Hypermedia Back in REST with JAX-RS
Putting Hypermedia Back in REST with JAX-RS
PT.JUG
 
Useful Design Patterns for Enterprise Applications with Java
Useful Design Patterns for Enterprise Applications with JavaUseful Design Patterns for Enterprise Applications with Java
Useful Design Patterns for Enterprise Applications with Java
PT.JUG
 
Flame Graphs, uma (boa) alternativa para profiling de apps Java
Flame Graphs, uma (boa) alternativa para profiling de apps JavaFlame Graphs, uma (boa) alternativa para profiling de apps Java
Flame Graphs, uma (boa) alternativa para profiling de apps Java
PT.JUG
 
To SOA or not to SOA
To SOA or not to SOATo SOA or not to SOA
To SOA or not to SOA
PT.JUG
 
Introduction to Grails Framework
Introduction to Grails FrameworkIntroduction to Grails Framework
Introduction to Grails Framework
PT.JUG
 
Apresentação LifeRay
Apresentação LifeRayApresentação LifeRay
Apresentação LifeRay
PT.JUG
 
Oracle Java Strategy Lg V3
Oracle Java Strategy Lg V3Oracle Java Strategy Lg V3
Oracle Java Strategy Lg V3
PT.JUG
 
Scripting na JVM
Scripting na JVMScripting na JVM
Scripting na JVM
PT.JUG
 
The tale of the Fénix architecture
The tale of the Fénix architectureThe tale of the Fénix architecture
The tale of the Fénix architecture
PT.JUG
 
Lightweight Grids With Terracotta
Lightweight Grids With TerracottaLightweight Grids With Terracotta
Lightweight Grids With Terracotta
PT.JUG
 
Google Web Toolkit
Google Web ToolkitGoogle Web Toolkit
Google Web Toolkit
PT.JUG
 
Developers Java: O que as empresas dizem que precisam mesmo mesmo
Developers Java: O que as empresas dizem que precisam mesmo mesmoDevelopers Java: O que as empresas dizem que precisam mesmo mesmo
Developers Java: O que as empresas dizem que precisam mesmo mesmo
PT.JUG
 

More from PT.JUG (13)

Overview of Eclipse technologies
Overview of Eclipse technologiesOverview of Eclipse technologies
Overview of Eclipse technologies
 
Putting Hypermedia Back in REST with JAX-RS
Putting Hypermedia Back in REST with JAX-RSPutting Hypermedia Back in REST with JAX-RS
Putting Hypermedia Back in REST with JAX-RS
 
Useful Design Patterns for Enterprise Applications with Java
Useful Design Patterns for Enterprise Applications with JavaUseful Design Patterns for Enterprise Applications with Java
Useful Design Patterns for Enterprise Applications with Java
 
Flame Graphs, uma (boa) alternativa para profiling de apps Java
Flame Graphs, uma (boa) alternativa para profiling de apps JavaFlame Graphs, uma (boa) alternativa para profiling de apps Java
Flame Graphs, uma (boa) alternativa para profiling de apps Java
 
To SOA or not to SOA
To SOA or not to SOATo SOA or not to SOA
To SOA or not to SOA
 
Introduction to Grails Framework
Introduction to Grails FrameworkIntroduction to Grails Framework
Introduction to Grails Framework
 
Apresentação LifeRay
Apresentação LifeRayApresentação LifeRay
Apresentação LifeRay
 
Oracle Java Strategy Lg V3
Oracle Java Strategy Lg V3Oracle Java Strategy Lg V3
Oracle Java Strategy Lg V3
 
Scripting na JVM
Scripting na JVMScripting na JVM
Scripting na JVM
 
The tale of the Fénix architecture
The tale of the Fénix architectureThe tale of the Fénix architecture
The tale of the Fénix architecture
 
Lightweight Grids With Terracotta
Lightweight Grids With TerracottaLightweight Grids With Terracotta
Lightweight Grids With Terracotta
 
Google Web Toolkit
Google Web ToolkitGoogle Web Toolkit
Google Web Toolkit
 
Developers Java: O que as empresas dizem que precisam mesmo mesmo
Developers Java: O que as empresas dizem que precisam mesmo mesmoDevelopers Java: O que as empresas dizem que precisam mesmo mesmo
Developers Java: O que as empresas dizem que precisam mesmo mesmo
 

Recently uploaded

Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
Vlad Stirbu
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
RinaMondal9
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
UiPathCommunity
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
James Anderson
 

Recently uploaded (20)

Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
 

Using JPA applications in the era of NoSQL: Introducing Hibernate OGM

  • 1. Coimbra, April 18th, 2012 Sanne Grinovero Hibernate Team, JBoss Red Hat, Inc
  • 2. About me • Hibernate in.relation.to/Bloggers/Sanne • Hibernate Search • Hibernate OGM Twitter: @SanneGrinovero • Infinispan • Lucene Directory • Infinispan Query Studied at FEUP (Porto)!
  • 3. Hibernate Object/Grid Mapper ? JPA for NoSQL • initially Key/Value store • we started with Infinispan
  • 4. Relational Databases • Transactions • Referential integrity • Simple Types • Well understood - tuning, backup, resilience
  • 5. Relational Databases But scaling is hard! -Replication -Multiple instances w/ shared disk -Sharding
  • 6. Relational Databases on a cloud Master/replicas: which master? A single master? I was promised elasticity Less reliable “disks” IP in configuration files? DNS update times? Who coordinates this? How does that failover?
  • 7. ¬SQL more meaning NotOnlySQL ¬SQL U SQL = anything
  • 8. No-SQL goals Very heterogeneus • Large datasets • High availability • Low latency / higher throughput • Specific data access pattern • Specific data structures • ...
  • 9. NotOnlySQL • Document based stores • Column based • Graph oriented databases • Key / value stores • Full-Text Search
  • 10. NotOnlySQL Choose one. Before starting. Stick to it.
  • 11. Flexibility at a cost • Programming model • one per product :-( • Often very thight code coupling • No standard drivers / stable APIs • no schema => app driven schema • query (Map Reduce, specific DSL, ...) • data structure transpires • Transactions ? • durability / consistency puzzles
  • 12. Where does Infinispan fit? Distributed Key/Value store • (or Replicated, local only efficient cache, invalidating cache) Each node is equal • Just start more nodes, or kill some No bottlenecks • by design Cloud-network friendly • JGroups • And “cloud storage” friendly too!
  • 13. But how to use it? map.put( “user-34”, userInstance ); map.get( “user-34” ); map.remove( “user-34” );
  • 14. It's a ConcurrentMap ! map.put( “user-34”, userInstance ); map.get( “user-34” ); map.remove( “user-34” ); map.putIfAbsent( “user-38”, another );
  • 15. Other Hibernate/Infinispan collaborations ● Second level cache for Hibernate ORM ● Hibernate Search indexing backend ● Infinispan Query
  • 16. Cloud-hack experiments Let's play with Infinispan's integration for Hibernate's second level cache design: - usually configured in clustering mode INVALIDATION. •Let's use DIST or REPL instead. - Disable expiry/timeouts. What's the effect on your cloud-deployed database?
  • 17. Cloud-hack experiments Now introduce Hibernate Search: - full-text queries should be handled by Lucene, NOT by the database. Hibernate Search identifies hits from the Lucene index, but loads them by PK. *by default
  • 18. What's the work left to the database?
  • 19. These tools are very appropriate for the job: Load by PK -> second level cache -> Key/Value store FullText query -> Hibernate Search -> Lucene Indexes
  • 20. These tools are very appropriate for the job: Load by PK -> second level cache -> Key/Value store FullText query -> Hibernate Search -> Lucene Indexes What if we now shut down the database?
  • 21.
  • 22. Goals • Encourage new data usage patterns • Familiar environment • Ease of use • Easy to jump in • Easy to jump out • Push NoSQL exploration in enterprises • “PaaS for existing API” initiative
  • 23. What it does • JPA front end to key/value stores • Object CRUD (incl polymorphism and associations) • OO queries (JP-QL) • Reuses • Hibernate Core • Hibernate Search (and Lucene) • Infinispan • Is not a silver bullet • not for all NoSQL use cases
  • 25. Schema or no schema? • Schema-less • move to new schema very easy • app deal with old and new structure or migrate all data • need strict development guidelines • Schema • reduce likelihood of rogue developer corruption • share with other apps • “didn’t think about that” bugs reduced
  • 26. Entities as serialized blobs? • Serialize objects into the (key) value • store the whole graph? • maintain consistency with duplicated objects • guaranteed identity a == b • concurrency / latency • structure change and (de)serialization, class definition changes
  • 27. OGM’s approach to schema • Keep what’s best from relational model • as much as possible • tables / columns / pks • Decorrelate object structure from data structure • Data stored as (self-described) tuples • Core types limited • portability
  • 28. OGM’s approach to schema • Store metadata for queries • Lucene index • CRUD operations are key lookups
  • 29. How does it work? • Entities are stored as tuples (Map<String,Object>) • Or Documents? • The key is composed of • table name • entity id • Collections are represented as a list of tuples - The key is composed of: • table name hosting the collection information • column names representing the FK • column values representing the FK
  • 30.
  • 31. Let's see some code...
  • 32. Queries / Infinispan • Hibernate Search indexes entities • Store Lucene indexes in Infinispan • JP-QL to Lucene query transformation • Works for simple queries • Lucene is not a relational SQL engine
  • 33. select a from Animal a where a.size > 20 > animalQueryBuilder .range().onField(“size”).above(20).excludeLimit() .createQuery(); select u from Order o join o.user u where o.price > 100 and u.city = “Paris” > orderQB.bool() .must( orderQB.range() .onField(“price”).above(100).excludeLimit().createQuery() ) .must( orderQB.keyword(“user.city”).matching(“Paris”) .createQuery() ).createQuery();
  • 34. Why Infinispan? • We know it well • Supports transactions • Supports distribution of Lucene indexes • Designed for clouds • It's a key/value store with support for Map/Reduce • Simple • Likely a common point for many other “databases”
  • 35. Why Infinispan? •Map/Reduce as an alternative to indexed queries •Might be chosen by a clever JP-QL engine •Potential for additional query types
  • 36.
  • 37. Why ? Nothing new to learn for most common operations: • JPA models • JP-QL queries Everything else is performance tuning, including: • Move to/from different NoSQL implementations • Move to/from a SQL implementation • Move to/from clouds/laptops • JPA is a well known standard: move to/from Hibernate :-)
  • 38. Development state: • Query via Hibernate Search • Smart JP-QL parser is on github • Available in master: • EHCache • Infinispan • In development branches: • MongoDB • Voldemort
  • 39. Summary • Performance / scalability is different • Isolation is different
  • 41. http://www.jboss.org/jbw2011keynote.html https://github.com/Sanne/tweets-ogm
  • 42. Q+A