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

Más contenido relacionado

La actualidad más candente

LTR: Open Source Integrated Library Systems
LTR: Open Source Integrated Library SystemsLTR: Open Source Integrated Library Systems
LTR: Open Source Integrated Library Systems
koegeljm
 
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
Alfredo Abate
 

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

Destacado

Mongo sf easy java persistence
Mongo sf   easy java persistenceMongo sf   easy java persistence
Mongo sf easy java persistence
Scott Hernandez
 
Java Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDBJava Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDB
MongoDB
 
MongoDB Java Development - MongoBoston 2010
MongoDB Java Development - MongoBoston 2010MongoDB Java Development - MongoBoston 2010
MongoDB Java Development - MongoBoston 2010
Eliot Horowitz
 

Destacado (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 a 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 mybatis
Will Iverson
 
Microsoft Openness Mongo DB
Microsoft Openness Mongo DBMicrosoft Openness Mongo DB
Microsoft Openness Mongo DB
Heriyadi Janwar
 
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
 
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
Open Analytics
 

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

Más de 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
 
Enterprise Java Virtualization, Sacha Labourey
Enterprise Java Virtualization, Sacha LaboureyEnterprise Java Virtualization, Sacha Labourey
Enterprise Java Virtualization, Sacha Labourey
OpenBlend society
 

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

Último

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Último (20)

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
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
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
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
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
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 

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