SlideShare une entreprise Scribd logo
1  sur  45
Télécharger pour lire hors ligne
The following is intended to outline our general product direction. It is
    intended for information purposes only, and may not be incorporated
    into any contract. It is not a commitment to deliver any material, code,
    or functionality, and should not be relied upon in making purchasing
    decisions. The development, release, and timing of any features or
    functionality described for Oracle’s products remains at the sole
    discretion of Oracle.




1   Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
2   Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
The Evolution of Java Persistence
Shaun Smith
shaun.smith@oracle.com
 3 @shaunMsmith
     Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
Software Evolution
    • Computing architecture is constantly evolving:
      Mainframe, client/server, web/thin client, mobile/apps, ...
    • Current technologies with increasing adoption include:
          – Cloud computing
          – HTML 5
          – NoSQL databases
    • Java EE 7 is evolving to address many of these new
      requirements


4   Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
Evolutionary Pressures on Persistence
    • Shared Services & Consolidation
          – Multitenancy
    • Mobile Clients
          – JPA-RS
    • Scaling/Elastic Capacity
          – Data Partitioning
          – NoSQL/Big Data/Fast Data
          – Grid Caching



5   Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
EclipseLink Project
    • Open Source Eclipse Project
          – Founded with contribution of Oracle TopLink to Eclipse
            Foundation
    • Object-Relational: Java Persistence API (JPA)
          – JPA 1.0 part of EJB 3.0 standard (JSR 220)
          – JPA 2.0 standardized in JSR 317
          – EclipseLink is JPA 2.0 & 2.1 Reference Implementation
    • Object-XML: Java Architecture for XML Binding (JAXB)
          – JAXB 2.2 Certified Implementation


6   Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
MULTITENANCY



7   Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
Multitenancy
    Wikipedia http://en.wikipedia.org/wiki/Multitenancy
    • Multitenancy refers to a principle in software architecture
      where a single instance of the software runs on a server,
      serving multiple client organizations (tenants).
    • Multitenancy is contrasted with a multi-instance
      architecture where separate software instances (or
      hardware systems) are set up for different client
      organizations.


8   Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
Application Development and the Cloud
    • Past
          – Single Tenant or non-Tenant Applications
          – Dedicated application instance and database
    • Today..Tomorrow
          – Support multiple tenants
          – Support extensibility (custom fields per tenant)
          – Support various deployment architectures
                   • Dedicated or shared application instances
                   • Dedicated or shared databases



9   Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
Multitenant Topologies
                                                                                          Application

                                                                              Dedicated                 Shared
                                                                              T1    T2    T3            T1   T2   T3


                        Dedicated
Database




                                                                               1    2      3            1    2    3

                                                                               T1    T2    T3           T1   T2   T3


                              Shared
                                                                                     1                       1
                                                                                     2                       2
                                                                                     3                       3


           Note: Single application deployed to support various MT architectures

10     Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
Multitenant Topologies
                                                                                          Application

                                                                              Dedicated                 Shared
                                                                              T1    T2    T3            T1   T2   T3


                        Dedicated
Database




                                                                               1    2      3            1    2    3

                                                                               T1    T2    T3           T1   T2   T3


                              Shared
                                                                                     1                       1
                                                                                     2                       2
                                                                                     3                       3


           Note: Single application deployed to support various MT architectures

11     Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
In the beginning…
     • Application dedicated for single tenant
     • All rows available to all queries

          @Entity
          public class Player {

           PLAYER
                             ID                                 VERSION         F_NAME   L_NAME   LEAGUE
                              1                                             1    John     Doe      HTHL
                              2                                             3    Jane     Doe      OSL




12   Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
Multitenant: SINGLE_TABLE
     • Simple configuration: Annotation or XML
     • Flexible tenant identifier support
     • EclipseLink augments generated SQL

           @Entity
           @Multitenant(SINGLE_TABLE)
           @TenantDiscriminatorColumn(name=“league-id”, columnName=“LEAGUE”)
           public class Player {
           PLAYER
                            ID                                  VERSION         F_NAME   L_NAME   LEAGUE
                              1                                             1    John     Doe      HTHL
                              2                                             3    Jane     Doe      OSL

13   Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
Multitenant: TENANT_PER_TABLE
     • Simple configuration: Annotation or XML
     • EclipseLink queries table based on tentant identifier
           @Entity
           @Multitenant(TABLE_PER_TENANT)
           public class Player {
                                                                            HTHL.PLAYER

                                                                                   ID     VERSION   F_NAME   L_NAME

                                                                                    1        1       John     Doe


                                                                            OSL.PLAYER

                                                                                   ID     VERSION   F_NAME   L_NAME

                                                                                    2        3       Jane     Doe




14   Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
DEMO-MULTITENANCY



15   Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
DOMAIN MODEL EXTENSIONS



16   Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
Domain Model Extensions
     • Storage and querying of extended properties
           –      Application developer enables extensions in entity
           –      Schema created with extension columns/table(s)
           –      Application Admin stores extension definitions
           –      Application instances made aware of extension definitions
           –      Application users make use of extensions


                                  Employee
                                         id                                 extensions            *   name
                                    firstName                                                         value
                                    lastName                                Map<String, Object>

17   Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
Flex Extensions
@VirtualAccessMethods
public class Player{
…
@Transient
private Map<String, Object> attributes;

public <T> T get(String attributeName) {
        return (T) this.attributes.get(attributeName);
}
public Object set(String attributeName, Object value) {
         return this.attributes.put(attributeName, value);
}

PLAYER
ID                             F_NAME                               L_NAME       FLEX_1   FLEX_2
1                              John                                 Doe          ‘R’      ’22’
2                              Jane                                 Smith        ‘NONE’

     18   Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
Virtual Access Mappings
<entity class="example.mysports.model.Player">
      <attributes>
                <basic name="penaltyMinutes" access="VIRTUAL"
                                            attribute-type="java.lang.Integer">
                            <column name="flex_1"/>
                </basic>
                <basic name="position" access="VIRTUAL"
                                attribute-type="java.lang.String">
                            <column name="flex_2"/>
                </basic>
      </attributes>
</entity>


 19   Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
DEMO DOMAIN MODEL EXTENSIONS



20   Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
JPA-RS



21   Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
Project Avatar
     Complete Solution for Dynamic Rich Clients



HTML 5 browser

                                                                             JSON over
HTML & Java                                                                 WebSocket/
hybrid application                                                          Server Send
                                                                               Events


 Java application                                                                         Java EE Cloud

22   Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
JPA-RS: Building Block of Project Avatar
     • Exposes JPA mapped entities over REST via JAX-RS
     • Provides REST operations for persistence unit
                                                          REST              JPA
                                                          GET, HEAD         Find, Named Query, Meta-model
                                                          PUT, POST         Persist, Merge
                                                          DELETE            Remove

     • Content-Type and Accept-based content negotiation
           – XML or JSON
     • Client
           – HTML5 with JavaScript (primary focus)
           – JavaFX
23   Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
JPA/JAX-RS: Current Programming Model
                                                                                        GET http://…/order/4

                                                                                JAX-RS

                                                         Customer                Product            Order



                                                                            Shop Persistence Unit


                                                                                  JPA



24   Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
JAX-RS with JPA Example – GET Invoice


     public class InvoiceService {...




         public Invoice read(int id) {
                              return null;
         }
     ...
25   Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
JAX-RS with JPA Example – GET Invoice

     @Stateless
     public class InvoiceService {...




         public Invoice read(int id) {
                              return entityManager.find(Invoice.class, id);
         }
     ...
26   Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
JAX-RS with JPA Example – GET Invoice
     @Path("/invoice")
     @Stateless
     public class InvoiceService {...




         public Invoice read(int id) {
                              return entityManager.find(Invoice.class, id);
         }
                                                       http://[machine]:[port]/[web-context]/invoice/...
     ...
27   Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
JAX-RS with JPA Example – GET Invoice
     @Path("/invoice")
     @Stateless
     public class InvoiceService {...


         @GET
         @Path("{id}")
         public Invoice read(@PathParam("id") int id) {
                              return entityManager.find(Invoice.class, id);
         }
                                                       GET http://[machine]:[port]/[web-context]/invoice/4
     ...
28   Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
JAX-RS with JPA Example – GET Invoice
     @Path("/invoice")
     @Stateless
     public class InvoiceService {...
         @GET
         @Path("{id}")
         @Produces({"application/xml", "application/json"})
         public Invoice read(@PathParam("id") int id) {
                              return entityManager.find(Invoice.class, id);
         }
                                                       Accept: application/json
     ...                                               GET http://[machine]:[port]/[web-context]/invoice/4
29   Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
JPA-RS: Thin Server Architecture
                                                                                   GET http://…/<pu-name>/<entity>/4

                                                                            JPA-RS

                                                    Shop PU                               … PU




                                                                             JPA



30   Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
JPA-RS: Building Block of Project Avatar
     • Persistence Unit Operations
           – /<root-uri>/<pu-name>/entity
           – /<root-uri>/<pu-name>/query
           – /<root-uri>/<pu-name>/metadata
     • Supports invocation of @NamedQueries via HTTP
     • Server-caching – EclipseLink clustered cache
     • Dynamic Persistence also supported
           – Entities defined via metadata – no Java classes required
           – Enables persistence for HTML5/JavaScript apps

31   Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
Client with Server Development

                                                                                                         Client
                                                                            HTML5
                                                                      JavaScript
                                                                            Native
                                dev
Client
Developer




                                                                                       Server                     Data
                                   dev
Server                                                                       Java EE            JPA-RS
Developer
                                 config

32   Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
MySports – Java EE
     Clients
                                                                                                                     Data
                                                                                   Server
                                                                                   MySports


                                                        HTTP/S               JSF     EJB      JPA             JDBC




                                                                                                  ORACLE
                                                                                               CONFIDENTIA
33    Copyright © 2011, Oracle and/or its affiliates. All rights reserved.                     L - INTERNAL
                                                                                                    ONLY
MySports – JPA-RS Enabled
     Clients
                                                                                                                      Data
                                                                                    Server
                                                                                    MySports

                                                                             JSF
                                                        HTTP/S                        EJB      JPA             JDBC
                                                                             JPA-
                                                                              RS




                                                                                                   ORACLE
                                                                                                CONFIDENTIA
34    Copyright © 2011, Oracle and/or its affiliates. All rights reserved.                      L - INTERNAL
                                                                                                     ONLY
JAX-RS DEMO



35   Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
NOSQL PERSISTENCE



41   Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
NoSQL Databases
     • NoSQL (i.e., non-relational) database are increasingly
       popular
     • No standards
     • Differing APIs and feature sets
     • Some offer query language/API—some not




42   Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
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”)
43   Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
Example MongoDB Mapped Entity




44   Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
MongoDB Query Examples
     JPQL Queries:
         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();




45   Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
Polyglot Persistence
     • Relationships can span databases—and technologies!




                                                                        Order   Discount




46   Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
NOSQL DEMO



47   Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
Summary
     • Java is evolving—and EclipseLink is evolving too!
           –      Tenant Isolation/Multitenancy
           –      JSON Binding
           –      JPA-RS
           –      NoSQL
           –      Polyglot Persistence
     • EclipseLink is the center of innovation in Java
       persistence



48   Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
Q&A




                              Provide Feedback, Get Involved!
                              User forums and lists at http://eclipse.org/eclipselink

49   Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
50   Copyright © 2011, Oracle and/or its affiliates. All rights reserved.

Contenu connexe

En vedette

Understanding Java Garbage Collection and What You Can Do About It: Gil Tene
Understanding Java Garbage Collection and What You Can Do About It: Gil TeneUnderstanding Java Garbage Collection and What You Can Do About It: Gil Tene
Understanding Java Garbage Collection and What You Can Do About It: Gil Tenejaxconf
 
The economies of scaling software - Abdel Remani
The economies of scaling software - Abdel RemaniThe economies of scaling software - Abdel Remani
The economies of scaling software - Abdel Remanijaxconf
 
What you need to know about Lambdas - Jamie Allen
What you need to know about Lambdas - Jamie AllenWhat you need to know about Lambdas - Jamie Allen
What you need to know about Lambdas - Jamie Allenjaxconf
 
Future of the Web - Yehuda Katz
Future of the Web - Yehuda KatzFuture of the Web - Yehuda Katz
Future of the Web - Yehuda Katzjaxconf
 
The Spring 4 Update - Josh Long
The Spring 4 Update - Josh LongThe Spring 4 Update - Josh Long
The Spring 4 Update - Josh Longjaxconf
 
Getting started with Websocket and Server-sent Events using Java - Arun Gupta
Getting started with Websocket and Server-sent Events using Java - Arun Gupta Getting started with Websocket and Server-sent Events using Java - Arun Gupta
Getting started with Websocket and Server-sent Events using Java - Arun Gupta jaxconf
 
The New Reality: the Role of PaaS in Technology Innovation - Franklin Herbas
The New Reality: the Role of PaaS in Technology Innovation - Franklin HerbasThe New Reality: the Role of PaaS in Technology Innovation - Franklin Herbas
The New Reality: the Role of PaaS in Technology Innovation - Franklin Herbasjaxconf
 
Multi Client Development with Spring - Josh Long
Multi Client Development with Spring - Josh Long Multi Client Development with Spring - Josh Long
Multi Client Development with Spring - Josh Long jaxconf
 
Building an Impenetrable ZooKeeper - Kathleen Ting
Building an Impenetrable ZooKeeper - Kathleen TingBuilding an Impenetrable ZooKeeper - Kathleen Ting
Building an Impenetrable ZooKeeper - Kathleen Tingjaxconf
 
Java PaaS Comparisons - Khanderao Kand
Java PaaS Comparisons - Khanderao KandJava PaaS Comparisons - Khanderao Kand
Java PaaS Comparisons - Khanderao Kandjaxconf
 
Apache Hadoop and its role in Big Data architecture - Himanshu Bari
Apache Hadoop and its role in Big Data architecture - Himanshu BariApache Hadoop and its role in Big Data architecture - Himanshu Bari
Apache Hadoop and its role in Big Data architecture - Himanshu Barijaxconf
 

En vedette (11)

Understanding Java Garbage Collection and What You Can Do About It: Gil Tene
Understanding Java Garbage Collection and What You Can Do About It: Gil TeneUnderstanding Java Garbage Collection and What You Can Do About It: Gil Tene
Understanding Java Garbage Collection and What You Can Do About It: Gil Tene
 
The economies of scaling software - Abdel Remani
The economies of scaling software - Abdel RemaniThe economies of scaling software - Abdel Remani
The economies of scaling software - Abdel Remani
 
What you need to know about Lambdas - Jamie Allen
What you need to know about Lambdas - Jamie AllenWhat you need to know about Lambdas - Jamie Allen
What you need to know about Lambdas - Jamie Allen
 
Future of the Web - Yehuda Katz
Future of the Web - Yehuda KatzFuture of the Web - Yehuda Katz
Future of the Web - Yehuda Katz
 
The Spring 4 Update - Josh Long
The Spring 4 Update - Josh LongThe Spring 4 Update - Josh Long
The Spring 4 Update - Josh Long
 
Getting started with Websocket and Server-sent Events using Java - Arun Gupta
Getting started with Websocket and Server-sent Events using Java - Arun Gupta Getting started with Websocket and Server-sent Events using Java - Arun Gupta
Getting started with Websocket and Server-sent Events using Java - Arun Gupta
 
The New Reality: the Role of PaaS in Technology Innovation - Franklin Herbas
The New Reality: the Role of PaaS in Technology Innovation - Franklin HerbasThe New Reality: the Role of PaaS in Technology Innovation - Franklin Herbas
The New Reality: the Role of PaaS in Technology Innovation - Franklin Herbas
 
Multi Client Development with Spring - Josh Long
Multi Client Development with Spring - Josh Long Multi Client Development with Spring - Josh Long
Multi Client Development with Spring - Josh Long
 
Building an Impenetrable ZooKeeper - Kathleen Ting
Building an Impenetrable ZooKeeper - Kathleen TingBuilding an Impenetrable ZooKeeper - Kathleen Ting
Building an Impenetrable ZooKeeper - Kathleen Ting
 
Java PaaS Comparisons - Khanderao Kand
Java PaaS Comparisons - Khanderao KandJava PaaS Comparisons - Khanderao Kand
Java PaaS Comparisons - Khanderao Kand
 
Apache Hadoop and its role in Big Data architecture - Himanshu Bari
Apache Hadoop and its role in Big Data architecture - Himanshu BariApache Hadoop and its role in Big Data architecture - Himanshu Bari
Apache Hadoop and its role in Big Data architecture - Himanshu Bari
 

Similaire à The Evolution of Java Persistence in EclipseLink: Shaun Smith

Becoming a Node.js Ninja on Cloud Foundry - Open Tour London
Becoming a Node.js Ninja on Cloud Foundry - Open Tour LondonBecoming a Node.js Ninja on Cloud Foundry - Open Tour London
Becoming a Node.js Ninja on Cloud Foundry - Open Tour LondonAndy Piper
 
Architecture & Pitfalls of Logical Replication
Architecture & Pitfalls of Logical ReplicationArchitecture & Pitfalls of Logical Replication
Architecture & Pitfalls of Logical ReplicationAtsushi Torikoshi
 
LinuxCon Japan 2011 OSS IaaS BoF
LinuxCon Japan 2011 OSS IaaS BoFLinuxCon Japan 2011 OSS IaaS BoF
LinuxCon Japan 2011 OSS IaaS BoFMasanori Itoh
 
Real World Business Intelligence and Data Warehousing
Real World Business Intelligence and Data WarehousingReal World Business Intelligence and Data Warehousing
Real World Business Intelligence and Data Warehousingukc4
 
GlusterFS モジュール超概論
GlusterFS モジュール超概論GlusterFS モジュール超概論
GlusterFS モジュール超概論Keisuke Takahashi
 
Smalltalk in Enterprise Applications
Smalltalk in Enterprise ApplicationsSmalltalk in Enterprise Applications
Smalltalk in Enterprise ApplicationsESUG
 
Staying ahead of the multi-core revolution with CDT debug
Staying ahead of the multi-core revolution with CDT debugStaying ahead of the multi-core revolution with CDT debug
Staying ahead of the multi-core revolution with CDT debugmarckhouzam
 
Taking Advantage of XMetaL’s XInclude Support
Taking Advantage of XMetaL’s XInclude SupportTaking Advantage of XMetaL’s XInclude Support
Taking Advantage of XMetaL’s XInclude SupportXMetaL
 
Introduction to Kubernetes
Introduction to KubernetesIntroduction to Kubernetes
Introduction to KubernetesSamuel Dratwa
 
Becoming Node.js ninja on Cloud Foundry
Becoming Node.js ninja on Cloud FoundryBecoming Node.js ninja on Cloud Foundry
Becoming Node.js ninja on Cloud FoundryRaja Rao DV
 
"erlang, webmail and hibari" at Rakuten tech talk
"erlang, webmail and hibari" at Rakuten tech talk"erlang, webmail and hibari" at Rakuten tech talk
"erlang, webmail and hibari" at Rakuten tech talkCLOUDIAN KK
 
Munching & crunching - Lucene index post-processing
Munching & crunching - Lucene index post-processingMunching & crunching - Lucene index post-processing
Munching & crunching - Lucene index post-processingabial
 
1. gen1 evolution and architecture of t24-r10.01
1. gen1 evolution and architecture of t24-r10.011. gen1 evolution and architecture of t24-r10.01
1. gen1 evolution and architecture of t24-r10.01Emmanuel Boadu
 
Intro2 nodejs 2pm
Intro2 nodejs 2pmIntro2 nodejs 2pm
Intro2 nodejs 2pmRaja Rao DV
 
VoltDB : A Technical Overview
VoltDB : A Technical OverviewVoltDB : A Technical Overview
VoltDB : A Technical OverviewTim Callaghan
 
Long and winding road - 2014
Long and winding road  - 2014Long and winding road  - 2014
Long and winding road - 2014Connor McDonald
 
Introduction to MySQL Cluster
Introduction to MySQL ClusterIntroduction to MySQL Cluster
Introduction to MySQL ClusterAbel Flórez
 

Similaire à The Evolution of Java Persistence in EclipseLink: Shaun Smith (20)

CloverETL Training Sample
CloverETL Training SampleCloverETL Training Sample
CloverETL Training Sample
 
Becoming a Node.js Ninja on Cloud Foundry - Open Tour London
Becoming a Node.js Ninja on Cloud Foundry - Open Tour LondonBecoming a Node.js Ninja on Cloud Foundry - Open Tour London
Becoming a Node.js Ninja on Cloud Foundry - Open Tour London
 
Architecture & Pitfalls of Logical Replication
Architecture & Pitfalls of Logical ReplicationArchitecture & Pitfalls of Logical Replication
Architecture & Pitfalls of Logical Replication
 
LinuxCon Japan 2011 OSS IaaS BoF
LinuxCon Japan 2011 OSS IaaS BoFLinuxCon Japan 2011 OSS IaaS BoF
LinuxCon Japan 2011 OSS IaaS BoF
 
Real World Business Intelligence and Data Warehousing
Real World Business Intelligence and Data WarehousingReal World Business Intelligence and Data Warehousing
Real World Business Intelligence and Data Warehousing
 
GlusterFS モジュール超概論
GlusterFS モジュール超概論GlusterFS モジュール超概論
GlusterFS モジュール超概論
 
Smalltalk in Enterprise Applications
Smalltalk in Enterprise ApplicationsSmalltalk in Enterprise Applications
Smalltalk in Enterprise Applications
 
Staying ahead of the multi-core revolution with CDT debug
Staying ahead of the multi-core revolution with CDT debugStaying ahead of the multi-core revolution with CDT debug
Staying ahead of the multi-core revolution with CDT debug
 
Taking Advantage of XMetaL’s XInclude Support
Taking Advantage of XMetaL’s XInclude SupportTaking Advantage of XMetaL’s XInclude Support
Taking Advantage of XMetaL’s XInclude Support
 
Introduction to Kubernetes
Introduction to KubernetesIntroduction to Kubernetes
Introduction to Kubernetes
 
Becoming Node.js ninja on Cloud Foundry
Becoming Node.js ninja on Cloud FoundryBecoming Node.js ninja on Cloud Foundry
Becoming Node.js ninja on Cloud Foundry
 
"erlang, webmail and hibari" at Rakuten tech talk
"erlang, webmail and hibari" at Rakuten tech talk"erlang, webmail and hibari" at Rakuten tech talk
"erlang, webmail and hibari" at Rakuten tech talk
 
Munching & crunching - Lucene index post-processing
Munching & crunching - Lucene index post-processingMunching & crunching - Lucene index post-processing
Munching & crunching - Lucene index post-processing
 
1. gen1 evolution and architecture of t24-r10.01
1. gen1 evolution and architecture of t24-r10.011. gen1 evolution and architecture of t24-r10.01
1. gen1 evolution and architecture of t24-r10.01
 
Erlang os
Erlang osErlang os
Erlang os
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
 
Intro2 nodejs 2pm
Intro2 nodejs 2pmIntro2 nodejs 2pm
Intro2 nodejs 2pm
 
VoltDB : A Technical Overview
VoltDB : A Technical OverviewVoltDB : A Technical Overview
VoltDB : A Technical Overview
 
Long and winding road - 2014
Long and winding road  - 2014Long and winding road  - 2014
Long and winding road - 2014
 
Introduction to MySQL Cluster
Introduction to MySQL ClusterIntroduction to MySQL Cluster
Introduction to MySQL Cluster
 

Dernier

What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????blackmambaettijean
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 

Dernier (20)

What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 

The Evolution of Java Persistence in EclipseLink: Shaun Smith

  • 1. The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle. 1 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
  • 2. 2 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
  • 3. The Evolution of Java Persistence Shaun Smith shaun.smith@oracle.com 3 @shaunMsmith Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
  • 4. Software Evolution • Computing architecture is constantly evolving: Mainframe, client/server, web/thin client, mobile/apps, ... • Current technologies with increasing adoption include: – Cloud computing – HTML 5 – NoSQL databases • Java EE 7 is evolving to address many of these new requirements 4 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
  • 5. Evolutionary Pressures on Persistence • Shared Services & Consolidation – Multitenancy • Mobile Clients – JPA-RS • Scaling/Elastic Capacity – Data Partitioning – NoSQL/Big Data/Fast Data – Grid Caching 5 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
  • 6. EclipseLink Project • Open Source Eclipse Project – Founded with contribution of Oracle TopLink to Eclipse Foundation • Object-Relational: Java Persistence API (JPA) – JPA 1.0 part of EJB 3.0 standard (JSR 220) – JPA 2.0 standardized in JSR 317 – EclipseLink is JPA 2.0 & 2.1 Reference Implementation • Object-XML: Java Architecture for XML Binding (JAXB) – JAXB 2.2 Certified Implementation 6 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
  • 7. MULTITENANCY 7 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
  • 8. Multitenancy Wikipedia http://en.wikipedia.org/wiki/Multitenancy • Multitenancy refers to a principle in software architecture where a single instance of the software runs on a server, serving multiple client organizations (tenants). • Multitenancy is contrasted with a multi-instance architecture where separate software instances (or hardware systems) are set up for different client organizations. 8 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
  • 9. Application Development and the Cloud • Past – Single Tenant or non-Tenant Applications – Dedicated application instance and database • Today..Tomorrow – Support multiple tenants – Support extensibility (custom fields per tenant) – Support various deployment architectures • Dedicated or shared application instances • Dedicated or shared databases 9 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
  • 10. Multitenant Topologies Application Dedicated Shared T1 T2 T3 T1 T2 T3 Dedicated Database 1 2 3 1 2 3 T1 T2 T3 T1 T2 T3 Shared 1 1 2 2 3 3 Note: Single application deployed to support various MT architectures 10 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
  • 11. Multitenant Topologies Application Dedicated Shared T1 T2 T3 T1 T2 T3 Dedicated Database 1 2 3 1 2 3 T1 T2 T3 T1 T2 T3 Shared 1 1 2 2 3 3 Note: Single application deployed to support various MT architectures 11 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
  • 12. In the beginning… • Application dedicated for single tenant • All rows available to all queries @Entity public class Player { PLAYER ID VERSION F_NAME L_NAME LEAGUE 1 1 John Doe HTHL 2 3 Jane Doe OSL 12 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
  • 13. Multitenant: SINGLE_TABLE • Simple configuration: Annotation or XML • Flexible tenant identifier support • EclipseLink augments generated SQL @Entity @Multitenant(SINGLE_TABLE) @TenantDiscriminatorColumn(name=“league-id”, columnName=“LEAGUE”) public class Player { PLAYER ID VERSION F_NAME L_NAME LEAGUE 1 1 John Doe HTHL 2 3 Jane Doe OSL 13 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
  • 14. Multitenant: TENANT_PER_TABLE • Simple configuration: Annotation or XML • EclipseLink queries table based on tentant identifier @Entity @Multitenant(TABLE_PER_TENANT) public class Player { HTHL.PLAYER ID VERSION F_NAME L_NAME 1 1 John Doe OSL.PLAYER ID VERSION F_NAME L_NAME 2 3 Jane Doe 14 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
  • 15. DEMO-MULTITENANCY 15 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
  • 16. DOMAIN MODEL EXTENSIONS 16 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
  • 17. Domain Model Extensions • Storage and querying of extended properties – Application developer enables extensions in entity – Schema created with extension columns/table(s) – Application Admin stores extension definitions – Application instances made aware of extension definitions – Application users make use of extensions Employee id extensions * name firstName value lastName Map<String, Object> 17 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
  • 18. Flex Extensions @VirtualAccessMethods public class Player{ … @Transient private Map<String, Object> attributes; public <T> T get(String attributeName) { return (T) this.attributes.get(attributeName); } public Object set(String attributeName, Object value) { return this.attributes.put(attributeName, value); } PLAYER ID F_NAME L_NAME FLEX_1 FLEX_2 1 John Doe ‘R’ ’22’ 2 Jane Smith ‘NONE’ 18 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
  • 19. Virtual Access Mappings <entity class="example.mysports.model.Player"> <attributes> <basic name="penaltyMinutes" access="VIRTUAL" attribute-type="java.lang.Integer"> <column name="flex_1"/> </basic> <basic name="position" access="VIRTUAL" attribute-type="java.lang.String"> <column name="flex_2"/> </basic> </attributes> </entity> 19 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
  • 20. DEMO DOMAIN MODEL EXTENSIONS 20 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
  • 21. JPA-RS 21 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
  • 22. Project Avatar Complete Solution for Dynamic Rich Clients HTML 5 browser JSON over HTML & Java WebSocket/ hybrid application Server Send Events Java application Java EE Cloud 22 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
  • 23. JPA-RS: Building Block of Project Avatar • Exposes JPA mapped entities over REST via JAX-RS • Provides REST operations for persistence unit REST JPA GET, HEAD Find, Named Query, Meta-model PUT, POST Persist, Merge DELETE Remove • Content-Type and Accept-based content negotiation – XML or JSON • Client – HTML5 with JavaScript (primary focus) – JavaFX 23 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
  • 24. JPA/JAX-RS: Current Programming Model GET http://…/order/4 JAX-RS Customer Product Order Shop Persistence Unit JPA 24 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
  • 25. JAX-RS with JPA Example – GET Invoice public class InvoiceService {... public Invoice read(int id) { return null; } ... 25 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
  • 26. JAX-RS with JPA Example – GET Invoice @Stateless public class InvoiceService {... public Invoice read(int id) { return entityManager.find(Invoice.class, id); } ... 26 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
  • 27. JAX-RS with JPA Example – GET Invoice @Path("/invoice") @Stateless public class InvoiceService {... public Invoice read(int id) { return entityManager.find(Invoice.class, id); } http://[machine]:[port]/[web-context]/invoice/... ... 27 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
  • 28. JAX-RS with JPA Example – GET Invoice @Path("/invoice") @Stateless public class InvoiceService {... @GET @Path("{id}") public Invoice read(@PathParam("id") int id) { return entityManager.find(Invoice.class, id); } GET http://[machine]:[port]/[web-context]/invoice/4 ... 28 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
  • 29. JAX-RS with JPA Example – GET Invoice @Path("/invoice") @Stateless public class InvoiceService {... @GET @Path("{id}") @Produces({"application/xml", "application/json"}) public Invoice read(@PathParam("id") int id) { return entityManager.find(Invoice.class, id); } Accept: application/json ... GET http://[machine]:[port]/[web-context]/invoice/4 29 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
  • 30. JPA-RS: Thin Server Architecture GET http://…/<pu-name>/<entity>/4 JPA-RS Shop PU … PU JPA 30 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
  • 31. JPA-RS: Building Block of Project Avatar • Persistence Unit Operations – /<root-uri>/<pu-name>/entity – /<root-uri>/<pu-name>/query – /<root-uri>/<pu-name>/metadata • Supports invocation of @NamedQueries via HTTP • Server-caching – EclipseLink clustered cache • Dynamic Persistence also supported – Entities defined via metadata – no Java classes required – Enables persistence for HTML5/JavaScript apps 31 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
  • 32. Client with Server Development Client HTML5 JavaScript Native dev Client Developer Server Data dev Server Java EE JPA-RS Developer config 32 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
  • 33. MySports – Java EE Clients Data Server MySports HTTP/S JSF EJB JPA JDBC ORACLE CONFIDENTIA 33 Copyright © 2011, Oracle and/or its affiliates. All rights reserved. L - INTERNAL ONLY
  • 34. MySports – JPA-RS Enabled Clients Data Server MySports JSF HTTP/S EJB JPA JDBC JPA- RS ORACLE CONFIDENTIA 34 Copyright © 2011, Oracle and/or its affiliates. All rights reserved. L - INTERNAL ONLY
  • 35. JAX-RS DEMO 35 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
  • 36. NOSQL PERSISTENCE 41 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
  • 37. NoSQL Databases • NoSQL (i.e., non-relational) database are increasingly popular • No standards • Differing APIs and feature sets • Some offer query language/API—some not 42 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
  • 38. 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”) 43 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
  • 39. Example MongoDB Mapped Entity 44 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
  • 40. MongoDB Query Examples JPQL Queries: 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(); 45 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
  • 41. Polyglot Persistence • Relationships can span databases—and technologies! Order Discount 46 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
  • 42. NOSQL DEMO 47 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
  • 43. Summary • Java is evolving—and EclipseLink is evolving too! – Tenant Isolation/Multitenancy – JSON Binding – JPA-RS – NoSQL – Polyglot Persistence • EclipseLink is the center of innovation in Java persistence 48 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
  • 44. Q&A Provide Feedback, Get Involved! User forums and lists at http://eclipse.org/eclipselink 49 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.
  • 45. 50 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.