Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public1
Using NoSQL with ~JPA,
EclipseLink and Java E...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public2Copyright © 2012, Oracle and/or its affiliates...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public3
NoSQL Landscape
 Defined by non-conformance ...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public4
NoSQL Landscape
Adoption and Trends
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public5
Putting NoSQL in Perspective
Probably Not a R...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public6
The Case for JPA
 There often is a domain mo...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public7
Applying JPA to NoSQL
 JPA domain model conc...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public8
EclipseLink NoSQL
 Support JPA style access ...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public9
JPA/EclipseLink NoSQL Demo
https://github.com...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public10
Other JPA/NoSQL Solutions
 Hibernate OGM
– ...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public11
Similar NoSQL Solutions
 PlayOrm
– NoSQL ce...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public12
CDI Overview
 Next-generation dependency in...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public13
A Quick Look at CDI
 Basic dependency injec...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public14
The Case for CDI
 “Hibernate OGM is not exp...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public15
CDI NoSQL Demo
https://github.com/m-reza-rah...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public16
Java EE 8 Survey NoSQL Questions
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public17
Summary
 NoSQL getting attention, but still...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public18
Learn More
 Considerations for Using NoSQL ...
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public19
Upcoming SlideShare
Loading in...5
×

Using NoSQL with ~JPA, EclipseLink and Java EE

54,002

Published on

This session explores how NoSQL solutions like MongoDB, Cassandra, Neo4j, HBase and CouchDB can be used in a Java EE application with or without a JPA centric facade. Although the primary focus is on EclipseLink NoSQL, we will also cover Hibernate OGM, EasyCassandra, Morphia, etc as well as seeing how NoSQL can be used natively via basic CDI injection.

Published in: Technology
0 Comments
25 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
54,002
On Slideshare
0
From Embeds
0
Number of Embeds
79
Actions
Shares
0
Downloads
271
Comments
0
Likes
25
Embeds 0
No embeds

No notes for slide

Using NoSQL with ~JPA, EclipseLink and Java EE

  1. 1. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public1 Using NoSQL with ~JPA, EclipseLink and Java EE Reza Rahman Java EE Evangelist Reza.Rahman@Oracle.com @reza_rahman
  2. 2. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public2Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public Agenda  NoSQL Landscape  Using NoSQL with ~JPA  Using NoSQL with CDI
  3. 3. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public3 NoSQL Landscape  Defined by non-conformance to established RDMS paradigm – No SQL/queries, schemaless, weak referential integrity, no JOINs  Scalability and cost major motivators (ACID vs. BASE) – No transactions, eventual consistency, distributed nodes – In the end, may complement and not replace relational databases…  Extremely divergent, specialized products  Some taxonomies – Key/value, document, graph, etc  MongoDB, Cassandra, Google BigTable, CouchDB, HBase, Redis, Neo4j, Oracle NoSQL Wild, Wild West
  4. 4. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public4 NoSQL Landscape Adoption and Trends
  5. 5. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public5 Putting NoSQL in Perspective Probably Not a Replacement to RDBMS
  6. 6. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public6 The Case for JPA  There often is a domain model  Some parts of JPA fit NoSQL quite well*  Learning each diverging NoSQL product cumbersome, often unnecessary  Switching between NoSQL solutions difficult, particularly at various stages of application development  “Polyglot Persistence” difficult  NoSQL APIs generally low level, verbose
  7. 7. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public7 Applying JPA to NoSQL  JPA domain model concepts apply well to NoSQL – Entities, Embeddables, ElementCollection, OneToOne, OneToMany, ManyToOne, Version  Pure relational concepts may not apply well – CollectionTable, Column, SecondaryTable, SequenceGenerator, TableGenerator  JPA queries can fit relatively well – Basic finders (by identity, all) – JPQL—portable query language defined by the spec – Native query—lets you leverage database specific features
  8. 8. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public8 EclipseLink NoSQL  Support JPA style access to NoSQL databases – Leverage non-relational database support for JCA  Metadata to identify NoSQL entities (e.g., @NoSQL)  Support JPQL subset for each – Leverage what’s available  Initial support for MongoDB and Oracle NoSQL – More to come (Cassandra, HBase, CouchDB?)  Support mixing relational and non-relational data in single composite persistence unit (“polyglot persistence”)
  9. 9. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public9 JPA/EclipseLink NoSQL Demo https://github.com/m-reza-rahman/jpa-nosql-demo
  10. 10. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public10 Other JPA/NoSQL Solutions  Hibernate OGM – Utilizes Hibernate codebase for NoSQL – MongoDB, Cassandra, Neo4J, CouchDB, Infinispan, Ehcache – Tries to provide as much of JPA as possible, including queries via Hibernate Search/Lucene, relational mapping annotations  DataNucleus – Persistence layer behind Google App Engine (not JPA compliant) – MongoDB, Cassandra, HBase, Neo4J  Kundera – Cassandra, MongoDB, HBase, Redis, Neo4J, Oracle NoSQL, CouchDB  Easy-Cassandra – Cassandra only
  11. 11. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public11 Similar NoSQL Solutions  PlayOrm – NoSQL centric JPA flavored annotations – Focused on Play framework – Cassandra, MongoDB, HBase  Mophia – Annotations mirror JPA – MongoDB specific
  12. 12. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public12 CDI Overview  Next-generation dependency injection for Java EE  Synthesizes best ideas from Seam 2, Guice and Spring  Many innovative features on its own right  Focus on loose-coupling, Java-centric type-safety, annotations, expressiveness and ease-of-use  Large ecosystem rapidly evolving around CDI
  13. 13. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public13 A Quick Look at CDI  Basic dependency injection – @Inject, @Qualifier, @Named, @Stereotype, @Alternative, @Produces, @Disposes  Context management – @Dependent, @RequestScoped, @SessionScoped, @ConversationScoped, @ApplicationScoped  Lightweight Events – Event, @Observes  Interceptors/Decorators – @Interceptor, @Decorator  Portable Extensions SPI
  14. 14. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public14 The Case for CDI  “Hibernate OGM is not expected to be the Rosetta stone used to interact with all NoSQL solutions in all use cases”  No real domain model  Advanced, highly specialized features  Unsupported NoSQL solutions  Existing NoSQL API knowledge  Most NoSQL APIs POJO based, easy to integrate natively via CDI
  15. 15. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public15 CDI NoSQL Demo https://github.com/m-reza-rahman/cdi-nosql- demo
  16. 16. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public16 Java EE 8 Survey NoSQL Questions
  17. 17. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public17 Summary  NoSQL getting attention, but still immature, niche and volatile  Parts of JPA can apply well to NoSQL – many such initiatives including from Oracle  Most NoSQL APIs are good enough to integrate directly via CDI  Too soon to standardize NoSQL in Java EE?
  18. 18. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public18 Learn More  Considerations for Using NoSQL on Your Next Project – http://www.slideshare.net/VeryFatBoy/bcs-2013  EclipseLink NoSQL Examples – http://wiki.eclipse.org/EclipseLink/Examples/JPA/NoSQL  Hibernate OGM – http://hibernate.org/ogm/  DataNucleus – http://www.datanucleus.org  Kundera – https://github.com/impetus-opensource/Kundera/  Easy-Cassandra – https://github.com/otaviojava/Easy-Cassandra  Weld Docs – http://docs.jboss.org/weld/reference/latest/en-US/html/
  19. 19. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public19
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×