SlideShare a Scribd company logo
OpenBlend Ljubljana
September 15th, 2011




                                   Sanne Grinovero
                       Software Engineer at Red Hat
About me
• Hibernate
 • Hibernate Search
 • Hibernate OGM        in.relation.to/Bloggers/Sanne
• Infinispan
 • Lucene Directory
                        Twitter: @SanneGrinovero
 • Infinispan Query
What is Hibernate OGM ?

       JPA for NoSQL
   • initially Key/Value store
   • in particular 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
   being a not-only-thatone
basically makes it a definition of
     “everything else too”
         “no-category”
No-SQL goals
Very different
• 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
Flexibility at a cost

• Programming model
  • one per product :-(
• no schema => app driven schema
• query (Map Reduce, specific DSL, ...)
• data structure transpires
• Transaction
• durability / consistency
Quick Infinispan introduction
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!
Infinispan ABC

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 );
Something more about
              Infinispan
●
    Support for Transactions (XA)
●
    CacheLoaders
    ●
        Cassandra, JDBC, Amazon S3 (jclouds),...
●
    Tree API for JBossCache compatibility
●
    Lucene integration
    ●
      Two-fold
●
    Some Hibernate integrations
    ●
      Second level cache
    ●
      Hibernate Search indexing backend
Cloud-hack experiments
Let's abuse of Hibernate's second level cache
design, using Infinispan's implementation:
 - usually configured in clustering mode
 INVALIDATION. Let's use DIST 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
Cloud-hack experiments
Load by PK ->
      second level cache ->
           Key/Value store

FullText query ->
       Hibernate Search ->
            Lucene Indexes
Cloud-hack experiments
Load by PK ->
      second level cache ->
           Key/Value store

FullText query ->
       Hibernate Search ->
            Lucene Indexes

So what if you shut down the database?
Cloud-hack experiments
Load by PK ->
      second level cache ->
           Key/Value store

FullText query ->
       Hibernate Search ->
            Lucene Indexes

So what if you shut down the database?
   •No relational/SQL queries
   •You won't be able to write!
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>)
• The key is composed of
  • table name
  • entity id
• Collections are represented as a list of tuple
- The key is composed of:
    • table name hosting the collection information
    • column names representing the FK
    • column values representing the FK
Queries

• 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();
Demo
Why Infinispan?
• We know it well
• Supports transactions (!)
  • Research is going on to provide “cloud transactions”
    on more platforms
• It supports Lucene indexes distribution
• Easy to manage in 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
•Supports – experimentally – distributed
 Lucene queries
 •Since ISPN-200, merged last week
Why all this ?
Developers will only need to think about
• JPA models
• JP-QL queries

Everything else is perfomance 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 :-)
Summary
•JPA for NoSQL
•Reusing mature projects
•Keep the good of the relational model
•Query via Hibernate Search

•JP-QL support on its way
•Still early in the project
•Only Infinispan is integrated:
contributions welcome!
Summary


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

More Related Content

What's hot

KnowItPresentation
KnowItPresentationKnowItPresentation
KnowItPresentation
Chuan Su
 
10 Strategies for Developing Reliable Jakarta EE & MicroProfile Applications ...
10 Strategies for Developing Reliable Jakarta EE & MicroProfile Applications ...10 Strategies for Developing Reliable Jakarta EE & MicroProfile Applications ...
10 Strategies for Developing Reliable Jakarta EE & MicroProfile Applications ...
Payara
 
LTR: Open Source Integrated Library Systems
LTR: Open Source Integrated Library SystemsLTR: Open Source Integrated Library Systems
LTR: Open Source Integrated Library Systemskoegeljm
 
Avoiding.the.pitfallsof.oracle.migration.2013
Avoiding.the.pitfallsof.oracle.migration.2013Avoiding.the.pitfallsof.oracle.migration.2013
Avoiding.the.pitfallsof.oracle.migration.2013
EDB
 
Extending_EBS_12_1_3_with_APEX_5_0_COLLABORATE16
Extending_EBS_12_1_3_with_APEX_5_0_COLLABORATE16Extending_EBS_12_1_3_with_APEX_5_0_COLLABORATE16
Extending_EBS_12_1_3_with_APEX_5_0_COLLABORATE16Alfredo Abate
 
Cloud Development with Camel and Amazon Web Services
Cloud Development with Camel and Amazon Web ServicesCloud Development with Camel and Amazon Web Services
Cloud Development with Camel and Amazon Web Services
Robin Howlett
 
Java EE revisits design patterns
Java EE revisits design patterns Java EE revisits design patterns
Java EE revisits design patterns
Alex Theedom
 
CORE JAVA & ADVANCE JAVA
CORE JAVA & ADVANCE JAVACORE JAVA & ADVANCE JAVA
CORE JAVA & ADVANCE JAVA
BALUJAINSTITUTE
 
CORE JAVA & ADVANCE JAVA
CORE JAVA & ADVANCE JAVACORE JAVA & ADVANCE JAVA
CORE JAVA & ADVANCE JAVA
BALUJAINSTITUTE
 
Fun with Kubernetes and Payara Micro 5
Fun with Kubernetes and Payara Micro 5Fun with Kubernetes and Payara Micro 5
Fun with Kubernetes and Payara Micro 5
Payara
 
5 Tips to Simplify the Management of Your Postgres Database
5 Tips to Simplify the Management of Your Postgres Database5 Tips to Simplify the Management of Your Postgres Database
5 Tips to Simplify the Management of Your Postgres Database
EDB
 

What's hot (11)

KnowItPresentation
KnowItPresentationKnowItPresentation
KnowItPresentation
 
10 Strategies for Developing Reliable Jakarta EE & MicroProfile Applications ...
10 Strategies for Developing Reliable Jakarta EE & MicroProfile Applications ...10 Strategies for Developing Reliable Jakarta EE & MicroProfile Applications ...
10 Strategies for Developing Reliable Jakarta EE & MicroProfile Applications ...
 
LTR: Open Source Integrated Library Systems
LTR: Open Source Integrated Library SystemsLTR: Open Source Integrated Library Systems
LTR: Open Source Integrated Library Systems
 
Avoiding.the.pitfallsof.oracle.migration.2013
Avoiding.the.pitfallsof.oracle.migration.2013Avoiding.the.pitfallsof.oracle.migration.2013
Avoiding.the.pitfallsof.oracle.migration.2013
 
Extending_EBS_12_1_3_with_APEX_5_0_COLLABORATE16
Extending_EBS_12_1_3_with_APEX_5_0_COLLABORATE16Extending_EBS_12_1_3_with_APEX_5_0_COLLABORATE16
Extending_EBS_12_1_3_with_APEX_5_0_COLLABORATE16
 
Cloud Development with Camel and Amazon Web Services
Cloud Development with Camel and Amazon Web ServicesCloud Development with Camel and Amazon Web Services
Cloud Development with Camel and Amazon Web Services
 
Java EE revisits design patterns
Java EE revisits design patterns Java EE revisits design patterns
Java EE revisits design patterns
 
CORE JAVA & ADVANCE JAVA
CORE JAVA & ADVANCE JAVACORE JAVA & ADVANCE JAVA
CORE JAVA & ADVANCE JAVA
 
CORE JAVA & ADVANCE JAVA
CORE JAVA & ADVANCE JAVACORE JAVA & ADVANCE JAVA
CORE JAVA & ADVANCE JAVA
 
Fun with Kubernetes and Payara Micro 5
Fun with Kubernetes and Payara Micro 5Fun with Kubernetes and Payara Micro 5
Fun with Kubernetes and Payara Micro 5
 
5 Tips to Simplify the Management of Your Postgres Database
5 Tips to Simplify the Management of Your Postgres Database5 Tips to Simplify the Management of Your Postgres Database
5 Tips to Simplify the Management of Your Postgres Database
 

Viewers also liked

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 driver for mongo db
Java driver for mongo dbJava driver for mongo db
Java driver for mongo db
Abhay Pai
 
Java Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDBJava Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDB
Tobias Trelle
 
Mongo sf easy java persistence
Mongo sf   easy java persistenceMongo sf   easy java persistence
Mongo sf easy java persistenceScott Hernandez
 
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
 
Using JPA applications in the era of NoSQL: Introducing Hibernate OGM
Using JPA applications in the era of NoSQL: Introducing Hibernate OGMUsing JPA applications in the era of NoSQL: Introducing Hibernate OGM
Using JPA applications in the era of NoSQL: Introducing Hibernate OGM
PT.JUG
 
MongoDB for Beginners
MongoDB for BeginnersMongoDB for Beginners
MongoDB for Beginners
Enoch Joshua
 
Mongo db
Mongo dbMongo db
Mongo db
Akshay Mathur
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
Ravi Teja
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
Mike Dirolf
 
Java Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDBJava Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDBMongoDB
 
MongoDB Java Development - MongoBoston 2010
MongoDB Java Development - MongoBoston 2010MongoDB Java Development - MongoBoston 2010
MongoDB Java Development - MongoBoston 2010Eliot Horowitz
 

Viewers also liked (15)

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 driver for mongo db
Java driver for mongo dbJava driver for mongo db
Java driver for mongo db
 
Java Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDBJava Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDB
 
Mongo sf easy java persistence
Mongo sf   easy java persistenceMongo sf   easy java persistence
Mongo sf easy java persistence
 
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
 
Using JPA applications in the era of NoSQL: Introducing Hibernate OGM
Using JPA applications in the era of NoSQL: Introducing Hibernate OGMUsing JPA applications in the era of NoSQL: Introducing Hibernate OGM
Using JPA applications in the era of NoSQL: Introducing Hibernate OGM
 
MongoDB for Beginners
MongoDB for BeginnersMongoDB for Beginners
MongoDB for Beginners
 
Mongo DB
Mongo DBMongo DB
Mongo DB
 
Mongo db
Mongo dbMongo db
Mongo db
 
Mongo DB
Mongo DBMongo DB
Mongo DB
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
Java Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDBJava Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDB
 
MongoDB Java Development - MongoBoston 2010
MongoDB Java Development - MongoBoston 2010MongoDB Java Development - MongoBoston 2010
MongoDB Java Development - MongoBoston 2010
 

Similar to Introducing Hibernate OGM: porting JPA applications to NoSQL, Sanne Grinovero (JBoss by RedHat)

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
 
RavenDB in the wild
RavenDB in the wildRavenDB in the wild
RavenDB in the wild
Mauro Servienti
 
Impala Architecture presentation
Impala Architecture presentationImpala Architecture presentation
Impala Architecture presentation
hadooparchbook
 
Microsoft Openness Mongo DB
Microsoft Openness Mongo DBMicrosoft Openness Mongo DB
Microsoft Openness Mongo DBHeriyadi Janwar
 
Data Modeling for NoSQL
Data Modeling for NoSQLData Modeling for NoSQL
Data Modeling for NoSQL
Tony Tam
 
An Introduction to Elastic Search.
An Introduction to Elastic Search.An Introduction to Elastic Search.
An Introduction to Elastic Search.
Jurriaan Persyn
 
Bigdata antipatterns
Bigdata antipatternsBigdata antipatterns
Bigdata antipatterns
Anurag S
 
CosmosDB for DBAs & Developers
CosmosDB for DBAs & DevelopersCosmosDB for DBAs & Developers
CosmosDB for DBAs & Developers
Niko Neugebauer
 
SQL To NoSQL - Top 6 Questions Before Making The Move
SQL To NoSQL - Top 6 Questions Before Making The MoveSQL To NoSQL - Top 6 Questions Before Making The Move
SQL To NoSQL - Top 6 Questions Before Making The Move
IBM Cloud Data Services
 
Solr cloud the 'search first' nosql database extended deep dive
Solr cloud the 'search first' nosql database   extended deep diveSolr cloud the 'search first' nosql database   extended deep dive
Solr cloud the 'search first' nosql database extended deep dive
lucenerevolution
 
NoSQL, Apache SOLR and Apache Hadoop
NoSQL, Apache SOLR and Apache HadoopNoSQL, Apache SOLR and Apache Hadoop
NoSQL, Apache SOLR and Apache Hadoop
Dmitry Kan
 
New Persistence Features in Spring Roo 1.1
New Persistence Features in Spring Roo 1.1New Persistence Features in Spring Roo 1.1
New Persistence Features in Spring Roo 1.1
Stefan Schmidt
 
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
 
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
 
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
 
Cool NoSQL on Azure with DocumentDB
Cool NoSQL on Azure with DocumentDBCool NoSQL on Azure with DocumentDB
Cool NoSQL on Azure with DocumentDB
Jan Hentschel
 
Dev nexus 2017
Dev nexus 2017Dev nexus 2017
Dev nexus 2017
Roy Russo
 
No sql and sql - open analytics summit
No sql and sql - open analytics summitNo sql and sql - open analytics summit
No sql and sql - open analytics summitOpen Analytics
 

Similar to Introducing Hibernate OGM: porting JPA applications to NoSQL, Sanne Grinovero (JBoss by RedHat) (20)

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
 
RavenDB in the wild
RavenDB in the wildRavenDB in the wild
RavenDB in the wild
 
NoSQL_Night
NoSQL_NightNoSQL_Night
NoSQL_Night
 
Impala Architecture presentation
Impala Architecture presentationImpala Architecture presentation
Impala Architecture presentation
 
Microsoft Openness Mongo DB
Microsoft Openness Mongo DBMicrosoft Openness Mongo DB
Microsoft Openness Mongo DB
 
Data Modeling for NoSQL
Data Modeling for NoSQLData Modeling for NoSQL
Data Modeling for NoSQL
 
An Introduction to Elastic Search.
An Introduction to Elastic Search.An Introduction to Elastic Search.
An Introduction to Elastic Search.
 
Bigdata antipatterns
Bigdata antipatternsBigdata antipatterns
Bigdata antipatterns
 
CosmosDB for DBAs & Developers
CosmosDB for DBAs & DevelopersCosmosDB for DBAs & Developers
CosmosDB for DBAs & Developers
 
SQL To NoSQL - Top 6 Questions Before Making The Move
SQL To NoSQL - Top 6 Questions Before Making The MoveSQL To NoSQL - Top 6 Questions Before Making The Move
SQL To NoSQL - Top 6 Questions Before Making The Move
 
Solr cloud the 'search first' nosql database extended deep dive
Solr cloud the 'search first' nosql database   extended deep diveSolr cloud the 'search first' nosql database   extended deep dive
Solr cloud the 'search first' nosql database extended deep dive
 
NoSQL, Apache SOLR and Apache Hadoop
NoSQL, Apache SOLR and Apache HadoopNoSQL, Apache SOLR and Apache Hadoop
NoSQL, Apache SOLR and Apache Hadoop
 
New Persistence Features in Spring Roo 1.1
New Persistence Features in Spring Roo 1.1New Persistence Features in Spring Roo 1.1
New Persistence Features in Spring Roo 1.1
 
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...
 
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?
 
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
 
Cool NoSQL on Azure with DocumentDB
Cool NoSQL on Azure with DocumentDBCool NoSQL on Azure with DocumentDB
Cool NoSQL on Azure with DocumentDB
 
Dev nexus 2017
Dev nexus 2017Dev nexus 2017
Dev nexus 2017
 
No sql and sql - open analytics summit
No sql and sql - open analytics summitNo sql and sql - open analytics summit
No sql and sql - open analytics summit
 

More from OpenBlend society

Byteman and The Jokre, Sanne Grinovero (JBoss by RedHat)
Byteman and The Jokre, Sanne Grinovero (JBoss by RedHat)Byteman and The Jokre, Sanne Grinovero (JBoss by RedHat)
Byteman and The Jokre, Sanne Grinovero (JBoss by RedHat)OpenBlend society
 
Seam 3 from a Web developer’s point of view, Matija Mazi (Parsek)
Seam 3 from a Web developer’s point of view, Matija Mazi (Parsek)Seam 3 from a Web developer’s point of view, Matija Mazi (Parsek)
Seam 3 from a Web developer’s point of view, Matija Mazi (Parsek)OpenBlend society
 
Memory is the new disk, disk is the new tape, Bela Ban (JBoss by RedHat)
Memory is the new disk, disk is the new tape, Bela Ban (JBoss by RedHat)Memory is the new disk, disk is the new tape, Bela Ban (JBoss by RedHat)
Memory is the new disk, disk is the new tape, Bela Ban (JBoss by RedHat)OpenBlend society
 
Java SE 7 - The Platform Evolves, Dalibor Topić (Oracle)
Java SE 7 - The Platform Evolves, Dalibor Topić (Oracle)Java SE 7 - The Platform Evolves, Dalibor Topić (Oracle)
Java SE 7 - The Platform Evolves, Dalibor Topić (Oracle)OpenBlend society
 
How to cuddle your EJBs, Carlo de Wolf
How to cuddle your EJBs, Carlo de WolfHow to cuddle your EJBs, Carlo de Wolf
How to cuddle your EJBs, Carlo de Wolf
OpenBlend society
 
Enterprise Java Virtualization, Sacha Labourey
Enterprise Java Virtualization, Sacha LaboureyEnterprise Java Virtualization, Sacha Labourey
Enterprise Java Virtualization, Sacha LaboureyOpenBlend society
 
OSGi & Java EE: A hybrid approach to Enterprise Java Application Development,...
OSGi & Java EE: A hybrid approach to Enterprise Java Application Development,...OSGi & Java EE: A hybrid approach to Enterprise Java Application Development,...
OSGi & Java EE: A hybrid approach to Enterprise Java Application Development,...
OpenBlend society
 
Tackling Actual Problems on the Wings of the Netbeans Platform, Jure Polutnik
Tackling Actual Problems on the Wings of the Netbeans Platform, Jure PolutnikTackling Actual Problems on the Wings of the Netbeans Platform, Jure Polutnik
Tackling Actual Problems on the Wings of the Netbeans Platform, Jure Polutnik
OpenBlend society
 
Android Up Close, Martin Sonc
Android Up Close, Martin SoncAndroid Up Close, Martin Sonc
Android Up Close, Martin Sonc
OpenBlend society
 
Successful Application Lifecycle Management in heterogeneous environments, Ma...
Successful Application Lifecycle Management in heterogeneous environments, Ma...Successful Application Lifecycle Management in heterogeneous environments, Ma...
Successful Application Lifecycle Management in heterogeneous environments, Ma...
OpenBlend society
 
Becoming an Open Source developer, Dimitris Andreadis
Becoming an Open Source developer, Dimitris AndreadisBecoming an Open Source developer, Dimitris Andreadis
Becoming an Open Source developer, Dimitris Andreadis
OpenBlend society
 

More from OpenBlend society (11)

Byteman and The Jokre, Sanne Grinovero (JBoss by RedHat)
Byteman and The Jokre, Sanne Grinovero (JBoss by RedHat)Byteman and The Jokre, Sanne Grinovero (JBoss by RedHat)
Byteman and The Jokre, Sanne Grinovero (JBoss by RedHat)
 
Seam 3 from a Web developer’s point of view, Matija Mazi (Parsek)
Seam 3 from a Web developer’s point of view, Matija Mazi (Parsek)Seam 3 from a Web developer’s point of view, Matija Mazi (Parsek)
Seam 3 from a Web developer’s point of view, Matija Mazi (Parsek)
 
Memory is the new disk, disk is the new tape, Bela Ban (JBoss by RedHat)
Memory is the new disk, disk is the new tape, Bela Ban (JBoss by RedHat)Memory is the new disk, disk is the new tape, Bela Ban (JBoss by RedHat)
Memory is the new disk, disk is the new tape, Bela Ban (JBoss by RedHat)
 
Java SE 7 - The Platform Evolves, Dalibor Topić (Oracle)
Java SE 7 - The Platform Evolves, Dalibor Topić (Oracle)Java SE 7 - The Platform Evolves, Dalibor Topić (Oracle)
Java SE 7 - The Platform Evolves, Dalibor Topić (Oracle)
 
How to cuddle your EJBs, Carlo de Wolf
How to cuddle your EJBs, Carlo de WolfHow to cuddle your EJBs, Carlo de Wolf
How to cuddle your EJBs, Carlo de Wolf
 
Enterprise Java Virtualization, Sacha Labourey
Enterprise Java Virtualization, Sacha LaboureyEnterprise Java Virtualization, Sacha Labourey
Enterprise Java Virtualization, Sacha Labourey
 
OSGi & Java EE: A hybrid approach to Enterprise Java Application Development,...
OSGi & Java EE: A hybrid approach to Enterprise Java Application Development,...OSGi & Java EE: A hybrid approach to Enterprise Java Application Development,...
OSGi & Java EE: A hybrid approach to Enterprise Java Application Development,...
 
Tackling Actual Problems on the Wings of the Netbeans Platform, Jure Polutnik
Tackling Actual Problems on the Wings of the Netbeans Platform, Jure PolutnikTackling Actual Problems on the Wings of the Netbeans Platform, Jure Polutnik
Tackling Actual Problems on the Wings of the Netbeans Platform, Jure Polutnik
 
Android Up Close, Martin Sonc
Android Up Close, Martin SoncAndroid Up Close, Martin Sonc
Android Up Close, Martin Sonc
 
Successful Application Lifecycle Management in heterogeneous environments, Ma...
Successful Application Lifecycle Management in heterogeneous environments, Ma...Successful Application Lifecycle Management in heterogeneous environments, Ma...
Successful Application Lifecycle Management in heterogeneous environments, Ma...
 
Becoming an Open Source developer, Dimitris Andreadis
Becoming an Open Source developer, Dimitris AndreadisBecoming an Open Source developer, Dimitris Andreadis
Becoming an Open Source developer, Dimitris Andreadis
 

Recently uploaded

The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
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
 
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
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
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
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
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
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Nexer Digital
 
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
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
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
 
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
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 

Recently uploaded (20)

The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
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
 
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
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
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
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
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
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
 
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
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
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
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 

Introducing Hibernate OGM: porting JPA applications to NoSQL, Sanne Grinovero (JBoss by RedHat)

  • 1. OpenBlend Ljubljana September 15th, 2011 Sanne Grinovero Software Engineer at Red Hat
  • 2. About me • Hibernate • Hibernate Search • Hibernate OGM in.relation.to/Bloggers/Sanne • Infinispan • Lucene Directory Twitter: @SanneGrinovero • Infinispan Query
  • 3. What is Hibernate OGM ? JPA for NoSQL • initially Key/Value store • in particular 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 being a not-only-thatone basically makes it a definition of “everything else too” “no-category”
  • 8. No-SQL goals Very different • 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. Flexibility at a cost • Programming model • one per product :-( • no schema => app driven schema • query (Map Reduce, specific DSL, ...) • data structure transpires • Transaction • durability / consistency
  • 11. Quick Infinispan introduction 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!
  • 12. Infinispan ABC map.put( “user-34”, userInstance ); map.get( “user-34” ); map.remove( “user-34” );
  • 13. It's a ConcurrentMap ! map.put( “user-34”, userInstance ); map.get( “user-34” ); map.remove( “user-34” ); map.putIfAbsent( “user-38”, another );
  • 14. Something more about Infinispan ● Support for Transactions (XA) ● CacheLoaders ● Cassandra, JDBC, Amazon S3 (jclouds),... ● Tree API for JBossCache compatibility ● Lucene integration ● Two-fold ● Some Hibernate integrations ● Second level cache ● Hibernate Search indexing backend
  • 15. Cloud-hack experiments Let's abuse of Hibernate's second level cache design, using Infinispan's implementation: - usually configured in clustering mode INVALIDATION. Let's use DIST instead. - Disable expiry/timeouts. What's the effect on your cloud-deployed database?
  • 16. 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
  • 17. Cloud-hack experiments Load by PK -> second level cache -> Key/Value store FullText query -> Hibernate Search -> Lucene Indexes
  • 18. Cloud-hack experiments Load by PK -> second level cache -> Key/Value store FullText query -> Hibernate Search -> Lucene Indexes So what if you shut down the database?
  • 19. Cloud-hack experiments Load by PK -> second level cache -> Key/Value store FullText query -> Hibernate Search -> Lucene Indexes So what if you shut down the database? •No relational/SQL queries •You won't be able to write!
  • 20.
  • 21. 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
  • 22. 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
  • 24. 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
  • 25. 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
  • 26. 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
  • 27. OGM’s approach to schema • Store metadata for queries • Lucene index • CRUD operations are key lookups
  • 28. How does it work? • Entities are stored as tuples (Map<String,Object>) • The key is composed of • table name • entity id • Collections are represented as a list of tuple - The key is composed of: • table name hosting the collection information • column names representing the FK • column values representing the FK
  • 29.
  • 30. Queries • 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
  • 31. 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();
  • 32. Demo
  • 33. Why Infinispan? • We know it well • Supports transactions (!) • Research is going on to provide “cloud transactions” on more platforms • It supports Lucene indexes distribution • Easy to manage in clouds • It's a key/value store with support for Map/Reduce • Simple • Likely a common point for many other “databases”
  • 34. Why Infinispan? •Map/Reduce as an alternative to indexed queries •Might be chosen by a clever JP-QL engine •Supports – experimentally – distributed Lucene queries •Since ISPN-200, merged last week
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40. Why all this ? Developers will only need to think about • JPA models • JP-QL queries Everything else is perfomance 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 :-)
  • 41. Summary •JPA for NoSQL •Reusing mature projects •Keep the good of the relational model •Query via Hibernate Search •JP-QL support on its way •Still early in the project •Only Infinispan is integrated: contributions welcome!
  • 42. Summary •Performance / scalability is different •Isolation is different
  • 44. http://www.jboss.org/jbw2011keynote.html https://github.com/Sanne/tweets-ogm
  • 45. Q+A