SlideShare una empresa de Scribd logo
1 de 42
Descargar para leer sin conexión
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

Más contenido relacionado

La actualidad más candente

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 DataJohn 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 ProfessionalsAlex Gorbachev
 
Dev nexus 2017
Dev nexus 2017Dev nexus 2017
Dev nexus 2017Roy Russo
 
Devnexus 2018
Devnexus 2018Devnexus 2018
Devnexus 2018Roy 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, EtsyLucidworks
 
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 SeattleDomino 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 SolrRahul 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 CapabilitiesBrett Meyer
 
Scaling MySQL using Fabric
Scaling MySQL using FabricScaling MySQL using Fabric
Scaling MySQL using FabricKarthik .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 Technologiesgagravarr
 
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 TechniquesBrett 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 cloudJustin Swanhart
 

La actualidad más candente (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
 

Destacado

Microservices
MicroservicesMicroservices
MicroservicesPT.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
 
An Introduction to Play 2 Framework
An Introduction to Play 2 FrameworkAn Introduction to Play 2 Framework
An Introduction to Play 2 FrameworkPT.JUG
 
Apache Camel
Apache CamelApache Camel
Apache CamelPT.JUG
 
JMockit & Hamcrest
JMockit & HamcrestJMockit & Hamcrest
JMockit & HamcrestPT.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 8PT.JUG
 
Introducing Java 8
Introducing Java 8Introducing Java 8
Introducing Java 8PT.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 MongoDBTobias Trelle
 
Java driver for mongo db
Java driver for mongo dbJava driver for mongo db
Java driver for mongo dbAbhay 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 InfinispanPT.JUG
 
Java development with MongoDB
Java development with MongoDBJava development with MongoDB
Java development with MongoDBJames Williams
 
Get expertise with mongo db
Get expertise with mongo dbGet expertise with mongo db
Get expertise with mongo dbAmit Thakkar
 
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 minutesAntonio Goncalves
 

Destacado (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 a 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 NoSQLTony Tam
 
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 Presentationargonauts007
 
Impala Architecture presentation
Impala Architecture presentationImpala Architecture presentation
Impala Architecture presentationhadooparchbook
 
Writing Scalable Software in Java
Writing Scalable Software in JavaWriting Scalable Software in Java
Writing Scalable Software in JavaRuben 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 DatabaseAndreas Jung
 
Scalability, Availability & Stability Patterns
Scalability, Availability & Stability PatternsScalability, Availability & Stability Patterns
Scalability, Availability & Stability PatternsJonas Bonér
 
hibernateormfeatures-140223193044-phpapp02.pdf
hibernateormfeatures-140223193044-phpapp02.pdfhibernateormfeatures-140223193044-phpapp02.pdf
hibernateormfeatures-140223193044-phpapp02.pdfPatiento 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 BitlySarah 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 2014Ricard 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 - LinkedInkbajda
 
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 EraHandaru Sakti
 
Workflow Engines for Hadoop
Workflow Engines for HadoopWorkflow Engines for Hadoop
Workflow Engines for HadoopJoe Crobak
 
Apache Spark Fundamentals
Apache Spark FundamentalsApache Spark Fundamentals
Apache Spark FundamentalsZahra 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 PracticesJen Aman
 

Similar a 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
 

Más de PT.JUG

Overview of Eclipse technologies
Overview of Eclipse technologiesOverview of Eclipse technologies
Overview of Eclipse technologiesPT.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-RSPT.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 JavaPT.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 JavaPT.JUG
 
To SOA or not to SOA
To SOA or not to SOATo SOA or not to SOA
To SOA or not to SOAPT.JUG
 
Introduction to Grails Framework
Introduction to Grails FrameworkIntroduction to Grails Framework
Introduction to Grails FrameworkPT.JUG
 
Apresentação LifeRay
Apresentação LifeRayApresentação LifeRay
Apresentação LifeRayPT.JUG
 
Oracle Java Strategy Lg V3
Oracle Java Strategy Lg V3Oracle Java Strategy Lg V3
Oracle Java Strategy Lg V3PT.JUG
 
Scripting na JVM
Scripting na JVMScripting na JVM
Scripting na JVMPT.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 architecturePT.JUG
 
Lightweight Grids With Terracotta
Lightweight Grids With TerracottaLightweight Grids With Terracotta
Lightweight Grids With TerracottaPT.JUG
 
Google Web Toolkit
Google Web ToolkitGoogle Web Toolkit
Google Web ToolkitPT.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 mesmoPT.JUG
 

Más de 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
 

Último

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 

Último (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 

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