Polyglot Persistence. EclipseLink JPA for NoSQL, Relational, and Beyond. Shaun Smith Gunnar Wagenknecht

Similar documents
Copyright 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 13

Building Java Persistence API Applications with Dali 1.0 Shaun Smith

TopLink Grid: Scaling JPA applications with Coherence

1 Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Introducing EclipseLink: The Eclipse Persistence Services Project

ECLIPSE PERSISTENCE PLATFORM (ECLIPSELINK) FAQ

The Evolution of Java Persistence

CO Java EE 6: Develop Database Applications with JPA

Index. setmaxresults() method, 169 sorting, 170 SQL DISTINCT query, 171 uniqueresult() method, 169

JPA The New Enterprise Persistence Standard

Java EE 7: Back-End Server Application Development

Table of Contents. I. Pre-Requisites A. Audience B. Pre-Requisites. II. Introduction A. The Problem B. Overview C. History

Pro Hibernate and. MongoDB. Anghel Leonard. Apress-

Model Driven Development with EMF and EclipseLink (experiences in MDD and generating user interfaces)

Efficient Object-Relational Mapping for JAVA and J2EE Applications or the impact of J2EE on RDB. Marc Stampfli Oracle Software (Switzerland) Ltd.

What data persistence means? We manipulate data (represented as object state) that need to be stored

How To Get Database Schema In Java Using >>>CLICK HERE<<<

Understanding Impact of J2EE Applications On Relational Databases. Dennis Leung, VP Development Oracle9iAS TopLink Oracle Corporation

Java Persistence API (JPA)

Object-relational mapping tools and Hibernate

Lightweight J2EE Framework

High Performance Persistence with EclipseLink

DATA ACCESS TECHNOLOGIES FOR JAVA GENERAL STUDY

Sustainable Service Design using Xtext Michael Bischoff arvato Systems GmbH

Dali Java Persistence Tools

Teneo: Integrating EMF & EclipseLink

foreword to the first edition preface xxi acknowledgments xxiii about this book xxv about the cover illustration

Java EE Architecture, Part Three. Java EE architecture, part three 1(57)

Hibernate OGM. Michal Linhard Quality Assurance Engineer, Red Hat. Red Hat Developer Conference February 17 th, 2012

An Oracle White Paper July Oracle WebLogic Suite 12c (12.1.2) Technical White Paper

<Insert Picture Here> Future<JavaEE>

Week 2 Unit 1: Introduction and First Steps with EJB. January, 2015

Schema Null Cannot Be Resolved For Table Jpa

Dynamic Database Schemas and Multi-Paradigm Persistence Transformations

EclipseLink. Solutions Guide for EclipseLink Release 2.6. June Beta Draft

purequery Deep Dive Part 2: Data Access Development Dan Galvin Galvin Consulting, Inc.

Coherence An Introduction. Shaun Smith Principal Product Manager

Migrating traditional Java EE applications to mobile

Java EE Architecture, Part Three. Java EE architecture, part three 1(69)

Hibernate Overview. By Khader Shaik

Eclipse Persistence Services The Full Monty

"Web Age Speaks!" Webinar Series

Oracle Corporation

Leverage Rational Application Developer v8 to develop Java EE6 application and test with WebSphere Application Server v8

Putting Oracle Database 11g to Work for Java. Kuassi Mensah Group Product Manager, Java Platform Group db360.blogspot.com

Hibernate OGM Architecture

YeSQL: Battling the NoSQL Hype Cycle with Postgres

ORACLE DATA SHEET KEY FEATURES AND BENEFITS ORACLE WEBLOGIC SUITE

Review. Fundamentals of Website Development. Web Extensions Server side & Where is your JOB? The Department of Computer Science 11/30/2015

Fast Track to EJB 3.0 and the JPA Using JBoss

CMP 436/774. Introduction to Java Enterprise Edition. Java Enterprise Edition

Java Persistence API. Patrick Linskey EJB Team Lead BEA Systems Oracle

Object-relational mapping EJB and Hibernate

Jakarta EE Meets NoSQL at the Cloud Age

Deployment. See Packaging and deployment processes

Creating Ultra-fast Realtime Apps and Microservices with Java. Markus Kett, CEO Jetstream Technologies

Introduction to JPA. Fabio Falcinelli

CO Java EE 7: Back-End Server Application Development

"Charting the Course... Mastering EJB 3.0 Applications. Course Summary

Enterprise JavaBeans, Version 3 (EJB3) Programming

Week 2 Unit 3: Creating a JDBC Application. January, 2015

Arun Gupta is a technology enthusiast, a passionate runner, and a community guy who works for Sun Microsystems. And this is his blog!

Java EE Architecture, Part Three. Java EE architecture, part three 1(24)

Setting Schema Name For Native Queries In. Hibernate >>>CLICK HERE<<<

Schema Management In Hibernate Interview. Questions >>>CLICK HERE<<<

Using ElasticSearch to Enable Stronger Query Support in Cassandra

Enterprise Java Development using JPA, Hibernate and Spring. Srini Penchikala Detroit JUG Developer Day Conference November 14, 2009

Eclipse Java Ejb 3.0 Tutorial For Beginners With Examples Pdf

Copyright Oracle Corporation and VMware Inc, Enterprise Modules Project (Gemini) Proposal

JPA Enhancement Guide (v5.1)

Java- EE Web Application Development with Enterprise JavaBeans and Web Services

Spring Framework 2.0 New Persistence Features. Thomas Risberg

Generating A Hibernate Mapping File And Java Classes From The Sql Schema

object/relational persistence What is persistence? 5

<Insert Picture Here> MySQL Cluster What are we working on

The Good, the Bad and the Ugly

Hibernate Search Googling your persistence domain model. Emmanuel Bernard Doer JBoss, a division of Red Hat

PaaS Cloud mit Java. Eberhard Wolff, Principal Technologist, SpringSource A division of VMware VMware Inc. All rights reserved

NOSQL DATABASE SYSTEMS: DATA MODELING. Big Data Technologies: NoSQL DBMS (Data Modeling) - SoSe

Web Application Development Using JEE, Enterprise JavaBeans and JPA

Supports 1-1, 1-many, and many to many relationships between objects

Gemini DBAccess Release Review February 2013

Web Application Development Using JEE, Enterprise JavaBeans and JPA

Applying Code Generation Approach in Fabrique Kirill Kalishev, JetBrains

Call: JSP Spring Hibernate Webservice Course Content:35-40hours Course Outline

Java Object/Relational Persistence with Hibernate. David Lucek 11 Jan 2005

Companion document for deliverable D2.2: Preliminary Prototype of the RDSTM and RSS

Introduction to Big Data. NoSQL Databases. Instituto Politécnico de Tomar. Ricardo Campos

Hands-on Development of Web Applications with Java EE 6

Entities are classes that need to be persisted, usually in a relational database. In this chapter we cover the following topics:

Migrating a Classic Hibernate Application to Use the WebSphere JPA 2.0 Feature Pack

Open ESB v2, Open ESB.next and Project Fuji. Andreas Egloff Lead Architect SOA / Business Integration Sun Microsystems

Overview. Principal Product Manager Oracle JDeveloper & Oracle ADF

Java J Course Outline

Java Persistence Query Language (JPQL)

Creating Enterprise and WorkGroup Applications with 4D ODBC

Enterprise Features & Requirements Analysis For EJB3 JPA & POJO Persistence. CocoBase Pure POJO

WAS V7 Application Development

Integrating Oracle Coherence 12c (12.2.1)

Monday, October 31, 11

Transcription:

Polyglot Persistence EclipseLink JPA for NoSQL, Relational, and Beyond Shaun Smith shaun.smith@oracle.com Gunnar Wagenknecht gunnar@wagenknecht.org 2012 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License

About Us Shaun Smith Oracle TopLink Product Manager TopLink Grid, Coherence GoldenGate Adapter, and NoSQL persistence Eclipse committer on EclipseLink and related projects Gunnar Wagenknecht CTO @ AGETO Committer and contributor @ Eclipse Java since 1999; Eclipse since 2001 2 Polyglot Persistence 2012 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License

Java Persistence: The Problem Space Customer id: int name: String creditrating: int Java JAXB <customer id= > <name> </name> <contact-info> </contact-info> </customer> XML JPA JPA DBWS CUST ID NAME C_RATING NoSQL Relational JPA: Java Persistence API JAXB: Java Architecture for XML Binding DBWS: EclipseLink Database WebServices 3 Polyglot Persistence 2012 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License

Java Persistence: The Problem Space Customer id: int name: String creditrating: int Java JPA CUST ID NAME C_RATING NoSQL Relational 4 Polyglot Persistence 2012 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License

JPA - Background A standardization of industry practices for Java POJO Object Relational Persistence Suitable for use in different modes Standalone in Java SE environment Hosted within a Java EE Container Merging of expertise from persistence vendors and communities including: TopLink, Hibernate, JDO, EJB vendors and individuals 5 Polyglot Persistence 2012 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License

Java Persistence API (JPA) - in a Nutshell Defines: How Java objects are stored in relational db A programmer API for reading, writing, and querying persistent Java objects ( Entities ) A full featured query language in JP QL a container contract that supports plugging any JPA runtime in to any compliant container Java Classes Persistence Descriptors Database Schema Java SE/EE Application JPA Provider JDBC Driver 6 Polyglot Persistence 2012 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License

NoSQL Databases NoSQL database are increasingly popular No common definition (document, graph, columnar) Differing feature sets Some offer query language/api some not No standards Every database offers a unique API Cost in terms of learning Zero portability across databases 7 Polyglot Persistence 2012 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License

EclipseLink NoSQL Support JPA access to NoSQL databases Leverage non-relational database support for JCA (and JDBC when available) Define annotations and XML to identify NoSQL stored entities (e.g., @NoSQL) Support JPQL subset for each Key principal: leverage what s available Initial support for MongoDB and Oracle NoSQL. Support mixing relational and non-relational data in single composite persistence unit ( polyglot persistence ) 8 Polyglot Persistence 2012 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License

Applicability of JPA to NoSQL Core JPA concepts apply to NoSQL: Persistent Entities, Embeddables, ElementCollection, OneToOne, OneToMany, ManyToOne, Version, etc. Some concepts apply with some databases: JPQL, NamedNativeQuery Pure relational concepts don t apply: CollectionTable, Column, SecondaryTable, SequenceGenerator, TableGenerator, etc. 9 Polyglot Persistence 2012 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License

Querying NoSQL with JPA Two kinds of queries JQPL portable query language defined by the spec Native query lets you leverage database specific features Dynamic or static @NamedQuery JPQL translated to underlying database query framework. 10 Polyglot Persistence 2012 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License

Example MongoDB Mapped Entity 11 Polyglot Persistence 2012 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License

MongoDB Query Examples JPQL Select o from Order o where o.totalcost > 1000 Select o from Order o where o.description like 'Pinball% Select o from Order o join o.orderlines l where l.cost > :cost Native Queries query = em.createnativequery( "db.order.findone({\"_id\":\"" + oid + "\"})", Order.class); Order order = (Order) query.getsingleresult(); 12 Polyglot Persistence 2012 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License

NOSQL PERSISTENCE DEMO 13 Polyglot Persistence 2012 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License

Polyglot Persistence Different data storage technologies for different kinds of data First ask, how we want to manipulate the data, then figure out what technology is the best bet for it Apparent even within a single application Cost of complexity http://martinfowler.com/bliki/polyglotpersistence.html NoSQL Distilled (Sadalage and Fowler, 2012) 14 Polyglot Persistence 2012 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License

Polyglot Persistence Relational and NoSQL databases each have their strength - choose the right one for the job A single application may have need for both relational and NoSQL data EclipseLink JPA supports use of multiple database technologies in the same application Relationships can span databases and database technologies 15 Polyglot Persistence 2012 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License

POLYGLOT PERSISTENCE DEMO 16 Polyglot Persistence 2012 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License

Experience / Best Practices MongoDB great for Sandbox development Start with NoSQL Go relational when model complete Remember: Two Worlds Think Auto-Commit No complex queries Don t be cool just because you can! 17 Polyglot Persistence 2012 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License

Tools Dali JPA Development Tools NoSQL specific Zero schema development in MongoDB Many MongoDB Admin GUIs (eg. MonjaDB in Eclipse) 18 Polyglot Persistence 2012 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License

EclipseLink vs. Morphia Morphia is MongoDB only uses JPA-like mappings clearly the JPA approach is amenable to NoSQL persistence 19 Polyglot Persistence 2012 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License

Morphia Observations Cannot combine with other DB technologies Non-Polyglot DB operation order must be managed by developer Extremely painful in practice EclipseLink offers comparable features with distinct advantages Polyglot, technology independent, ease of use 20 Polyglot Persistence 2012 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License

EclipseLink vs. Hibernate OGM OGM Object Grid Mapper initially focused on Infinispan Focused on storing entities in the Grid/NoSQL Imposes specific data storage format EclipseLink is focused on JPA access to NoSQL not simply NoSQL as dedicated entity store Relies on Lucene for search No native or JPQL translation to native query 21 Polyglot Persistence 2012 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License

Hibernate OGM Storage Format 22 Polyglot Persistence 2012 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License

EclipseLink NoSQL Next Step Gather community feedback Please contribute to the conversation! Support additional databases: Cassandra HBase CouchDB Long term standardization? 23 Polyglot Persistence 2012 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License

Useful Links EclipseLink http://www.eclipse.org/eclipslink EclipseLink NoSQL Examples http://wiki.eclipse.org/eclipselink/examples/jpa/ NoSQL James Sutherland s Blog http://java-persistence-performance.blogspot.com/ 24 Polyglot Persistence 2012 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License

25 Polyglot Persistence 2012 Oracle and AGETO; Licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License