SlideShare une entreprise Scribd logo
1  sur  30
Télécharger pour lire hors ligne
1   Markus Eisele, Insurance - Strategic IT-Architecture   msg systems ag, 17.10.2011
Agenda



        1.   What is JPA?
        2.   How does JPA work?
        3.   What is Coherence?
        4.   How does Coherence work?
        5.   Why Coherence with JPA?
        6.   „JOTG“ - JPA On The Grid
              1. JPA Backed Caches
              2. JPA 2nd Level Cache
              3. JPA 2nd Level Cache with JPA Backed Cache
        7. Summary




2                                 Markus Eisele, Insurance - Strategic IT-Architecture   msg systems ag, 17.10.2011
http://blog.eisele.net

http://twitter.com/myfear

markus.eisele@msg-systems.com
3                               Markus Eisele, Insurance - Strategic IT-Architecture   msg systems ag, 17.10.2011
What is JPA?




         • The Java Persistence API (JPA) is a Java
           programming language framework managing
           relational data in applications
         • The Java Persistence API originated as part of
           the work of the JSR 220 Expert Group. JPA
           2.0 is the work of the JSR 317 Expert Group.
         • Persistence in this context covers three areas:
              the API itself, defined in the javax.persistence
               package
              the Java Persistence Query Language (JPQL)
              object/relational metadata



4                            Markus Eisele, Insurance - Strategic IT-Architecture   msg systems ag, 17.10.2011
Typical Providers




5                       Markus Eisele, Insurance - Strategic IT-Architecture   msg systems ag, 17.10.2011
How does JPA work?




     http://glassfish.java.net/javaee5/persistence/persistence-example.html


6                                               Markus Eisele, Insurance - Strategic IT-Architecture   msg systems ag, 17.10.2011
JPA Entities                                                                 @Entity
                                                                                 @Table(name="ORDER_TABLE")
                                                                                 public class Order {

                                                                                     private int id;
         @Entity                                                                     private String address;
         public class Customer {                                                     private Customer customer;
             private int id;
             private String name;                                                    @Id
             private Collection<Order> orders;                                       @Column(name="ORDER_ID")
                                                                                     public int getId() {
             @Id                                                                       return id;
             public int getId() {
               return id;                                                            }
             }
                                                                                     public void setId(int id) {
             public void setId(int id) {                                               this.id = id;
               this.id = id;
             }                                                                       }

             public String getName() {                                               @Column(name="SHIPPING_ADDRESS")
               return name;                                                          public String getAddress() {
             }
                                                                                       return address;
             public void setName(String name) {                                      }
               this.name = name;
             }                                                                       public void setAddress(String address) {
             @OneToMany(cascade=ALL, mappedBy="customer")                              this.address = address;
             public Collection<Order> getOrders() {                                  }
               return orders;
             }                                                                       @ManyToOne()
             public void setOrders(Collection<Order> newValue) {                     @JoinColumn(name="CUSTOMER_ID")
               this.orders = newValue;                                               public Customer getCustomer() {
             }                                                                         return customer;
         }                                                                           }

                                                                                     public void setCustomer(Customer customer) {
                                                                                       this.customer = customer;
                                                                                     }

                                                                                 }


7                                                 Markus Eisele, Insurance - Strategic IT-Architecture                          msg systems ag, 17.10.2011
Working with the Entity Manager



          // Create new customer
         Customer customer0 = new Customer();
         customer0.setId(1);
         customer0.setName("Joe Smith");

         // Persist the customer
         em.persist(customer0);

          // Associate orders with the customer.
         customer0.getOrders().add(order1);
         order1.setCustomer(customer0);

         // Persist the customer
         em.persist(customer0);




8                                  Markus Eisele, Insurance - Strategic IT-Architecture   msg systems ag, 17.10.2011
What is Coherence?




9                        Markus Eisele, Insurance - Strategic IT-Architecture   msg systems ag, 17.10.2011
How Coherence works




10                         Markus Eisele, Insurance - Strategic IT-Architecture   msg systems ag, 17.10.2011
How Coherence works




11                         Markus Eisele, Insurance - Strategic IT-Architecture   msg systems ag, 17.10.2011
How Coherence works




12                         Markus Eisele, Insurance - Strategic IT-Architecture   msg systems ag, 17.10.2011
How Coherence works




         • Members have logical access to all Entities
                At most 2 network operations per access
                At most 4 network operations per update
                Regardless of cluster size
                Deterministic access and update behaviour




13                           Markus Eisele, Insurance - Strategic IT-Architecture   msg systems ag, 17.10.2011
What is TopLink Grid?




          • TopLink Grid is a component of Oracle
            TopLink
          • TopLink Grid allows Java developers to
            transparently leverage the power of the
            Coherence data grid
          • TopLink Grid combines:
                the simplicity of application development using the
                 Java standard Java Persistence API (JPA) with
                the scalability and distributed processing power of
                 Oracle’s Coherence Data Grid.




14                             Markus Eisele, Insurance - Strategic IT-Architecture   msg systems ag, 17.10.2011
What is TopLink Grid?




          • Supports 'JPA on the Grid' Architecture
                EclipseLink JPA applications using Coherence as a
                 shared (L2) cache replacement along with
                 configuration for more advanced usage
                TopLink Grid integrates EclipseLink JPA and
                 Coherence
                Base configuration uses Coherence data grid as
                 distributed shared cache
                Updates to Coherence cache immediately available
                 to all cluster nodes
                Advanced configurations uses data grid to process
                 queries to avoid database access and decrease
                 database load




15                            Markus Eisele, Insurance - Strategic IT-Architecture   msg systems ag, 17.10.2011
Why Coherence with JPA?




          • Historical approach to scaling a JPA
            application
               Adding nodes to a cluster
               Tuning database performance to reduce query time
          • Both of these approaches will support
            scalability but only to a point




16                             Markus Eisele, Insurance - Strategic IT-Architecture   msg systems ag, 17.10.2011
Why Coherence with JPA?


          •   Historical approach to scaling EclipseLink JPA applications
              into a cluster:
                Disable Shared Cache
                    Each transaction retrieves all required data from the database.
                     Increased database load limits overall scalability but ensures all
                     nodes have latest data.
                    Memory footprint of application increases as each transaction has a
                     copy of each required Entity
                    Every transaction pays object construction cost for queried Entities.
                    Database becomes bottleneck

                Cache Coordination
                    When Entity is modified in one node, other cluster nodes messaged to
                     replicate/invalidate shared cached Entities.
                    Creation and/or modification of Entity results in message to all other
                     nodes
                    Messaging latency means that nodes may have stale data for a short
                     period.
                    Shared cache size limited by heap of each node
                    Objects shared across transactions to reduce memory footprint




17                                  Markus Eisele, Insurance - Strategic IT-Architecture     msg systems ag, 17.10.2011
Strategies for JPA on the grid




18                                Markus Eisele, Insurance - Strategic IT-Architecture   msg systems ag, 17.10.2011
JPA Backed Caches – Traditional Approach


          •   Coherence API with caches backed by a
              database mapped through JPA.
          •   The grid accesses relational data through JPA
              CacheLoader and CacheStore
              implementations.
          •   TopLink Grid provides CacheLoader and
              CacheStore implementations that are
              optimized for EclipseLink JPA.
              (EclipseLinkJPACacheLoader and
              EclipseLinkJPACacheStore)
          •   Using the standard JPA run-time configuration
              file persistence.xml and the JPA mapping file
              orm.xml.
          •   The Coherence cache configuration file
              coherence-cache-config.xml must be specified
              to override the default Coherence settings and
              define the CacheStore caching scheme.

19                              Markus Eisele, Insurance - Strategic IT-Architecture   msg systems ag, 17.10.2011
Using the Traditional Approach



          // Get the configured Cache

          NamedCache cache =
          CacheFactory.getCache("Customer");

          //Create a new Customer
          Customer cust = new Customer();
          cust.setFirstName("Markus");
          cust.setLastName("Eisele");
          cust.setId(1);

          //Put the Employee into the cache
          cache.put(1, cust);




20                               Markus Eisele, Insurance - Strategic IT-Architecture   msg systems ag, 17.10.2011
JPA Second Level Cache – Grid Cache




          • Ensures all nodes have coherent view of
            data.
               Database is always right
               Shared Cache is always right—Entities
                read, modified, or created are available to
                all cluster members.
          • Communication is to primary and backup
            nodes.
          • Coherence cache size is the sum of the
            available heap of all members—larger
            cache size enables longer tenure and
            better cache hit rate
          • Can be used with existing applications
            and all EclipseLink performance features
            without altering application results


21                              Markus Eisele, Insurance - Strategic IT-Architecture   msg systems ag, 17.10.2011
Using the 2nd Level Cache



          ...
          import
          oracle.eclipselink.coherence.integrated.cache.Coherenc
          eInterceptor;
          import
          org.eclipse.persistence.annotations.CacheInterceptor;
          ...

          @Entity
          @CacheInterceptor(value = CoherenceInterceptor.class)
          public class Customer implements Serializable {
          ...
          }




22                               Markus Eisele, Insurance - Strategic IT-Architecture   msg systems ag, 17.10.2011
Configuring Optimizations



          •   Grid Read (@Customizer(CoherenceReadCustomizer.class))
              )

                   In the Grid Cache configuration, all reads (both pk and
                    non-pk) are executed against the grid (by default).
                   For Entities that typically:
                     Need to be highly available
                     Must have updates written synchronously to the database;
                       database is system of record
          •   Grid Entity (@Customizer(CoherenceReadWriteCustomizer.class))
                   The Grid Entity configuration is the same as the Grid
                    Read configuration except that all writes are executed
                    against the grid, not the database.
                   For Entities that typically:
                       May have updates written asynchronously to the database (if
                        CacheStore configured)




23                                  Markus Eisele, Insurance - Strategic IT-Architecture   msg systems ag, 17.10.2011
JPA 2nd Level Cache with JPA Backed Cache



          •   Combining both approaches is possible with
              some combinations

          •   Grid Entity
                  Can be optionally used with CacheStore to
                   update the database.


          •   Grid Read
                  Can be optionally used with CacheLoader.




24                                   Markus Eisele, Insurance - Strategic IT-Architecture   msg systems ag, 17.10.2011
Relationship Support



          •   Coherence does not provide support for the serialization of complex graphs across caches.
                 Coherence serializes objects/object graphs and places the results in to a single cache
                    under a key.
          •   TopLink Grid 11gR1 does support storage of complex graphs of Entities with each Entity type
              stored in a corresponding Coherence cache.
                 Relationship information is stored into Coherence
                 Relationships are reconstituted upon retrieval from Coherence
                 Lazy and eager relationships are supported
                 Relationships between Coherence cached and database persisted objects is supported.
          •   TopLink Grid wraps Entities with relationships with a byte code generated Wrapper class
              when put()ing into Coherence
                 Wrapper encodes relationship details
                 Wrapper is stripped off when Entity retrieved from Coherence and relationships are
                    reconstituted
                 Eager relationships will result is retrieval (from either Coherence or database depending
                    on configuration) of target Entity/Entities
          •   Non-TopLink Grid applications can query Entities from Coherence with Filters and get()
              wrapped Entities
                 TopLink Grid serializer must be configured on Cache
                 Coherence clients can configure auto-unwrapping
                 Relationships will be null when retrieved by Coherence clients




25                                        Markus Eisele, Insurance - Strategic IT-Architecture            msg systems ag, 17.10.2011
Summary




         • TopLink supports a range of strategies for scaling JPA
           applications
         • TopLink Grid integrates EclipseLink JPA with Oracle
           Coherence to provide:
                'JPA on the Grid' functionality to support scaling JPA
                 applications with Coherence
                Support for caching Entities with relationships in
                 Coherence
         • Both TopLink and Coherence are a part of WebLogic
           Application Grid




26                               Markus Eisele, Insurance - Strategic IT-Architecture   msg systems ag, 17.10.2011
ActiveCache !!!




          • Watch out for Oracle Active Cache
                Combination of Coherence with either WebLogic
                 Server or Oracle GlassFish Server.
                Session State Persistence and Management
                Accessing Java Persistence API (JPA) Entities in
                 the Data Cache




27                            Markus Eisele, Insurance - Strategic IT-Architecture   msg systems ag, 17.10.2011
Links and Readings



          http://blog.eisele.net

          http://www.oracle.com/technetwork/middleware/coherence/overview/index
          .html

          http://www.oracle.com/technetwork/middleware/toplink/overview/index.ht
          ml

          http://www.oracle.com/technetwork/middleware/toplink/tl-grid-097210.html

          http://www.eclipselink.org/

          http://java.sys-con.com/node/951117




28                                  Markus Eisele, Insurance - Strategic IT-Architecture   msg systems ag, 17.10.2011
Disclaimer




      The thoughts expressed here are
      the personal opinions of the author
      and no official statement
      of the msg systems ag.




29                   Markus Eisele, Oracle ACE Director FMW & SOA   msg systems ag, 2011
Thank you for your attention!




     Markus Eisele


     markus.eisele@msg-systems.com


     www.msg-systems.com




                                  www.msg-systems.com




30                         Markus Eisele, Insurance - Strategic IT-Architecture   msg systems ag, 17.10.2011

Contenu connexe

En vedette

Tema 16 acceso a base de datos usando jpa por gio
Tema 16   acceso a base de datos usando jpa por gioTema 16   acceso a base de datos usando jpa por gio
Tema 16 acceso a base de datos usando jpa por gioRobert Wolf
 
PrimeTime JSF with PrimeFaces - Dec 2014
PrimeTime JSF with PrimeFaces - Dec 2014PrimeTime JSF with PrimeFaces - Dec 2014
PrimeTime JSF with PrimeFaces - Dec 2014cagataycivici
 
Symfony2 Authentication
Symfony2 AuthenticationSymfony2 Authentication
Symfony2 AuthenticationOFlorin
 
Introduction to JPA and Hibernate including examples
Introduction to JPA and Hibernate including examplesIntroduction to JPA and Hibernate including examples
Introduction to JPA and Hibernate including examplesecosio GmbH
 
Java Persistence API (JPA) - A Brief Overview
Java Persistence API (JPA) - A Brief OverviewJava Persistence API (JPA) - A Brief Overview
Java Persistence API (JPA) - A Brief OverviewCraig Dickson
 
Java Persistence API (JPA) Step By Step
Java Persistence API (JPA) Step By StepJava Persistence API (JPA) Step By Step
Java Persistence API (JPA) Step By StepGuo Albert
 

En vedette (8)

JPA Best Practices
JPA Best PracticesJPA Best Practices
JPA Best Practices
 
Tema 16 acceso a base de datos usando jpa por gio
Tema 16   acceso a base de datos usando jpa por gioTema 16   acceso a base de datos usando jpa por gio
Tema 16 acceso a base de datos usando jpa por gio
 
PrimeTime JSF with PrimeFaces - Dec 2014
PrimeTime JSF with PrimeFaces - Dec 2014PrimeTime JSF with PrimeFaces - Dec 2014
PrimeTime JSF with PrimeFaces - Dec 2014
 
Jsfandsecurity
JsfandsecurityJsfandsecurity
Jsfandsecurity
 
Symfony2 Authentication
Symfony2 AuthenticationSymfony2 Authentication
Symfony2 Authentication
 
Introduction to JPA and Hibernate including examples
Introduction to JPA and Hibernate including examplesIntroduction to JPA and Hibernate including examples
Introduction to JPA and Hibernate including examples
 
Java Persistence API (JPA) - A Brief Overview
Java Persistence API (JPA) - A Brief OverviewJava Persistence API (JPA) - A Brief Overview
Java Persistence API (JPA) - A Brief Overview
 
Java Persistence API (JPA) Step By Step
Java Persistence API (JPA) Step By StepJava Persistence API (JPA) Step By Step
Java Persistence API (JPA) Step By Step
 

Similaire à High performance JPA with Oracle Coherence

That’s My App - Running in Your Background - Draining Your Battery
That’s My App - Running in Your Background - Draining Your BatteryThat’s My App - Running in Your Background - Draining Your Battery
That’s My App - Running in Your Background - Draining Your BatteryMichael Galpin
 
New Features of JSR 317 (JPA 2.0)
New Features of JSR 317 (JPA 2.0)New Features of JSR 317 (JPA 2.0)
New Features of JSR 317 (JPA 2.0)Markus Eisele
 
Paintfree Object-Document Mapping for MongoDB by Philipp Krenn
Paintfree Object-Document Mapping for MongoDB by Philipp KrennPaintfree Object-Document Mapping for MongoDB by Philipp Krenn
Paintfree Object-Document Mapping for MongoDB by Philipp KrennJavaDayUA
 
Implementing CQRS and Event Sourcing with RavenDB
Implementing CQRS and Event Sourcing with RavenDBImplementing CQRS and Event Sourcing with RavenDB
Implementing CQRS and Event Sourcing with RavenDBOren Eini
 
Domänenspezifische Sprachen mit Xtext
Domänenspezifische Sprachen mit XtextDomänenspezifische Sprachen mit Xtext
Domänenspezifische Sprachen mit XtextDr. Jan Köhnlein
 
IPC: AIDL is sexy, not a curse
IPC: AIDL is sexy, not a curseIPC: AIDL is sexy, not a curse
IPC: AIDL is sexy, not a curseYonatan Levin
 
Ipc: aidl sexy, not a curse
Ipc: aidl sexy, not a curseIpc: aidl sexy, not a curse
Ipc: aidl sexy, not a curseYonatan Levin
 
Java Persistence API 2.0: An Overview
Java Persistence API 2.0: An OverviewJava Persistence API 2.0: An Overview
Java Persistence API 2.0: An OverviewSanjeeb Sahoo
 
Java9 Beyond Modularity - Java 9 más allá de la modularidad
Java9 Beyond Modularity - Java 9 más allá de la modularidadJava9 Beyond Modularity - Java 9 más allá de la modularidad
Java9 Beyond Modularity - Java 9 más allá de la modularidadDavid Gómez García
 
比XML更好用的Java Annotation
比XML更好用的Java Annotation比XML更好用的Java Annotation
比XML更好用的Java Annotationjavatwo2011
 
重構—改善既有程式的設計(chapter 8)part 1
重構—改善既有程式的設計(chapter 8)part 1重構—改善既有程式的設計(chapter 8)part 1
重構—改善既有程式的設計(chapter 8)part 1Chris Huang
 
Combatendo code smells em Java
Combatendo code smells em Java Combatendo code smells em Java
Combatendo code smells em Java Emmanuel Neri
 
Learning from GOOS - work in progress
Learning from GOOS - work in progressLearning from GOOS - work in progress
Learning from GOOS - work in progressOlaf Lewitz
 
NoSQL Endgame Percona Live Online 2020
NoSQL Endgame Percona Live Online 2020NoSQL Endgame Percona Live Online 2020
NoSQL Endgame Percona Live Online 2020Thodoris Bais
 

Similaire à High performance JPA with Oracle Coherence (20)

Spring data
Spring dataSpring data
Spring data
 
That’s My App - Running in Your Background - Draining Your Battery
That’s My App - Running in Your Background - Draining Your BatteryThat’s My App - Running in Your Background - Draining Your Battery
That’s My App - Running in Your Background - Draining Your Battery
 
New Features of JSR 317 (JPA 2.0)
New Features of JSR 317 (JPA 2.0)New Features of JSR 317 (JPA 2.0)
New Features of JSR 317 (JPA 2.0)
 
Paintfree Object-Document Mapping for MongoDB by Philipp Krenn
Paintfree Object-Document Mapping for MongoDB by Philipp KrennPaintfree Object-Document Mapping for MongoDB by Philipp Krenn
Paintfree Object-Document Mapping for MongoDB by Philipp Krenn
 
SOLID Principles
SOLID PrinciplesSOLID Principles
SOLID Principles
 
Implementing CQRS and Event Sourcing with RavenDB
Implementing CQRS and Event Sourcing with RavenDBImplementing CQRS and Event Sourcing with RavenDB
Implementing CQRS and Event Sourcing with RavenDB
 
Domänenspezifische Sprachen mit Xtext
Domänenspezifische Sprachen mit XtextDomänenspezifische Sprachen mit Xtext
Domänenspezifische Sprachen mit Xtext
 
Java Persistence API
Java Persistence APIJava Persistence API
Java Persistence API
 
Encapsulation
EncapsulationEncapsulation
Encapsulation
 
IPC: AIDL is sexy, not a curse
IPC: AIDL is sexy, not a curseIPC: AIDL is sexy, not a curse
IPC: AIDL is sexy, not a curse
 
Ipc: aidl sexy, not a curse
Ipc: aidl sexy, not a curseIpc: aidl sexy, not a curse
Ipc: aidl sexy, not a curse
 
Java Persistence API 2.0: An Overview
Java Persistence API 2.0: An OverviewJava Persistence API 2.0: An Overview
Java Persistence API 2.0: An Overview
 
Java9 Beyond Modularity - Java 9 más allá de la modularidad
Java9 Beyond Modularity - Java 9 más allá de la modularidadJava9 Beyond Modularity - Java 9 más allá de la modularidad
Java9 Beyond Modularity - Java 9 más allá de la modularidad
 
比XML更好用的Java Annotation
比XML更好用的Java Annotation比XML更好用的Java Annotation
比XML更好用的Java Annotation
 
重構—改善既有程式的設計(chapter 8)part 1
重構—改善既有程式的設計(chapter 8)part 1重構—改善既有程式的設計(chapter 8)part 1
重構—改善既有程式的設計(chapter 8)part 1
 
Combatendo code smells em Java
Combatendo code smells em Java Combatendo code smells em Java
Combatendo code smells em Java
 
CDI @javaonehyderabad
CDI @javaonehyderabadCDI @javaonehyderabad
CDI @javaonehyderabad
 
Learning from GOOS - work in progress
Learning from GOOS - work in progressLearning from GOOS - work in progress
Learning from GOOS - work in progress
 
WebDSL
WebDSLWebDSL
WebDSL
 
NoSQL Endgame Percona Live Online 2020
NoSQL Endgame Percona Live Online 2020NoSQL Endgame Percona Live Online 2020
NoSQL Endgame Percona Live Online 2020
 

Plus de Markus Eisele

Sustainable Software Architecture - Open Tour DACH '22
Sustainable Software Architecture - Open Tour DACH '22Sustainable Software Architecture - Open Tour DACH '22
Sustainable Software Architecture - Open Tour DACH '22Markus Eisele
 
Going from java message service (jms) to eda
Going from java message service (jms) to eda Going from java message service (jms) to eda
Going from java message service (jms) to eda Markus Eisele
 
Let's be real. Quarkus in the wild.
Let's be real. Quarkus in the wild.Let's be real. Quarkus in the wild.
Let's be real. Quarkus in the wild.Markus Eisele
 
What happens when unicorns drink coffee
What happens when unicorns drink coffeeWhat happens when unicorns drink coffee
What happens when unicorns drink coffeeMarkus Eisele
 
Stateful on Stateless - The Future of Applications in the Cloud
Stateful on Stateless - The Future of Applications in the CloudStateful on Stateless - The Future of Applications in the Cloud
Stateful on Stateless - The Future of Applications in the CloudMarkus Eisele
 
Java in the age of containers - JUG Frankfurt/M
Java in the age of containers - JUG Frankfurt/MJava in the age of containers - JUG Frankfurt/M
Java in the age of containers - JUG Frankfurt/MMarkus Eisele
 
Java in the Age of Containers and Serverless
Java in the Age of Containers and ServerlessJava in the Age of Containers and Serverless
Java in the Age of Containers and ServerlessMarkus Eisele
 
Migrating from Java EE to cloud-native Reactive systems
Migrating from Java EE to cloud-native Reactive systemsMigrating from Java EE to cloud-native Reactive systems
Migrating from Java EE to cloud-native Reactive systemsMarkus Eisele
 
Streaming to a new Jakarta EE / JOTB19
Streaming to a new Jakarta EE / JOTB19Streaming to a new Jakarta EE / JOTB19
Streaming to a new Jakarta EE / JOTB19Markus Eisele
 
Cloud wars - A LavaOne discussion in seven slides
Cloud wars - A LavaOne discussion in seven slidesCloud wars - A LavaOne discussion in seven slides
Cloud wars - A LavaOne discussion in seven slidesMarkus Eisele
 
Streaming to a new Jakarta EE
Streaming to a new Jakarta EEStreaming to a new Jakarta EE
Streaming to a new Jakarta EEMarkus Eisele
 
Reactive Integrations - Caveats and bumps in the road explained
Reactive Integrations - Caveats and bumps in the road explained  Reactive Integrations - Caveats and bumps in the road explained
Reactive Integrations - Caveats and bumps in the road explained Markus Eisele
 
Stay productive while slicing up the monolith
Stay productive while slicing up the monolithStay productive while slicing up the monolith
Stay productive while slicing up the monolithMarkus Eisele
 
Stay productive while slicing up the monolith
Stay productive while slicing up the monolithStay productive while slicing up the monolith
Stay productive while slicing up the monolithMarkus Eisele
 
Stay productive_while_slicing_up_the_monolith
Stay productive_while_slicing_up_the_monolithStay productive_while_slicing_up_the_monolith
Stay productive_while_slicing_up_the_monolithMarkus Eisele
 
Architecting for failure - Why are distributed systems hard?
Architecting for failure - Why are distributed systems hard?Architecting for failure - Why are distributed systems hard?
Architecting for failure - Why are distributed systems hard?Markus Eisele
 
Stay productive while slicing up the monolith
Stay productive while slicing up the monolith Stay productive while slicing up the monolith
Stay productive while slicing up the monolith Markus Eisele
 
Nine Neins - where Java EE will never take you
Nine Neins - where Java EE will never take youNine Neins - where Java EE will never take you
Nine Neins - where Java EE will never take youMarkus Eisele
 
How lagom helps to build real world microservice systems
How lagom helps to build real world microservice systemsHow lagom helps to build real world microservice systems
How lagom helps to build real world microservice systemsMarkus Eisele
 
CQRS and Event Sourcing for Java Developers
CQRS and Event Sourcing for Java DevelopersCQRS and Event Sourcing for Java Developers
CQRS and Event Sourcing for Java DevelopersMarkus Eisele
 

Plus de Markus Eisele (20)

Sustainable Software Architecture - Open Tour DACH '22
Sustainable Software Architecture - Open Tour DACH '22Sustainable Software Architecture - Open Tour DACH '22
Sustainable Software Architecture - Open Tour DACH '22
 
Going from java message service (jms) to eda
Going from java message service (jms) to eda Going from java message service (jms) to eda
Going from java message service (jms) to eda
 
Let's be real. Quarkus in the wild.
Let's be real. Quarkus in the wild.Let's be real. Quarkus in the wild.
Let's be real. Quarkus in the wild.
 
What happens when unicorns drink coffee
What happens when unicorns drink coffeeWhat happens when unicorns drink coffee
What happens when unicorns drink coffee
 
Stateful on Stateless - The Future of Applications in the Cloud
Stateful on Stateless - The Future of Applications in the CloudStateful on Stateless - The Future of Applications in the Cloud
Stateful on Stateless - The Future of Applications in the Cloud
 
Java in the age of containers - JUG Frankfurt/M
Java in the age of containers - JUG Frankfurt/MJava in the age of containers - JUG Frankfurt/M
Java in the age of containers - JUG Frankfurt/M
 
Java in the Age of Containers and Serverless
Java in the Age of Containers and ServerlessJava in the Age of Containers and Serverless
Java in the Age of Containers and Serverless
 
Migrating from Java EE to cloud-native Reactive systems
Migrating from Java EE to cloud-native Reactive systemsMigrating from Java EE to cloud-native Reactive systems
Migrating from Java EE to cloud-native Reactive systems
 
Streaming to a new Jakarta EE / JOTB19
Streaming to a new Jakarta EE / JOTB19Streaming to a new Jakarta EE / JOTB19
Streaming to a new Jakarta EE / JOTB19
 
Cloud wars - A LavaOne discussion in seven slides
Cloud wars - A LavaOne discussion in seven slidesCloud wars - A LavaOne discussion in seven slides
Cloud wars - A LavaOne discussion in seven slides
 
Streaming to a new Jakarta EE
Streaming to a new Jakarta EEStreaming to a new Jakarta EE
Streaming to a new Jakarta EE
 
Reactive Integrations - Caveats and bumps in the road explained
Reactive Integrations - Caveats and bumps in the road explained  Reactive Integrations - Caveats and bumps in the road explained
Reactive Integrations - Caveats and bumps in the road explained
 
Stay productive while slicing up the monolith
Stay productive while slicing up the monolithStay productive while slicing up the monolith
Stay productive while slicing up the monolith
 
Stay productive while slicing up the monolith
Stay productive while slicing up the monolithStay productive while slicing up the monolith
Stay productive while slicing up the monolith
 
Stay productive_while_slicing_up_the_monolith
Stay productive_while_slicing_up_the_monolithStay productive_while_slicing_up_the_monolith
Stay productive_while_slicing_up_the_monolith
 
Architecting for failure - Why are distributed systems hard?
Architecting for failure - Why are distributed systems hard?Architecting for failure - Why are distributed systems hard?
Architecting for failure - Why are distributed systems hard?
 
Stay productive while slicing up the monolith
Stay productive while slicing up the monolith Stay productive while slicing up the monolith
Stay productive while slicing up the monolith
 
Nine Neins - where Java EE will never take you
Nine Neins - where Java EE will never take youNine Neins - where Java EE will never take you
Nine Neins - where Java EE will never take you
 
How lagom helps to build real world microservice systems
How lagom helps to build real world microservice systemsHow lagom helps to build real world microservice systems
How lagom helps to build real world microservice systems
 
CQRS and Event Sourcing for Java Developers
CQRS and Event Sourcing for Java DevelopersCQRS and Event Sourcing for Java Developers
CQRS and Event Sourcing for Java Developers
 

Dernier

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
 
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
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
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
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
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
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
"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
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
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
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
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
 
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
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 

Dernier (20)

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
 
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
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
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
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
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
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
"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
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
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
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
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
 
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
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 

High performance JPA with Oracle Coherence

  • 1. 1 Markus Eisele, Insurance - Strategic IT-Architecture msg systems ag, 17.10.2011
  • 2. Agenda 1. What is JPA? 2. How does JPA work? 3. What is Coherence? 4. How does Coherence work? 5. Why Coherence with JPA? 6. „JOTG“ - JPA On The Grid 1. JPA Backed Caches 2. JPA 2nd Level Cache 3. JPA 2nd Level Cache with JPA Backed Cache 7. Summary 2 Markus Eisele, Insurance - Strategic IT-Architecture msg systems ag, 17.10.2011
  • 3. http://blog.eisele.net http://twitter.com/myfear markus.eisele@msg-systems.com 3 Markus Eisele, Insurance - Strategic IT-Architecture msg systems ag, 17.10.2011
  • 4. What is JPA? • The Java Persistence API (JPA) is a Java programming language framework managing relational data in applications • The Java Persistence API originated as part of the work of the JSR 220 Expert Group. JPA 2.0 is the work of the JSR 317 Expert Group. • Persistence in this context covers three areas:  the API itself, defined in the javax.persistence package  the Java Persistence Query Language (JPQL)  object/relational metadata 4 Markus Eisele, Insurance - Strategic IT-Architecture msg systems ag, 17.10.2011
  • 5. Typical Providers 5 Markus Eisele, Insurance - Strategic IT-Architecture msg systems ag, 17.10.2011
  • 6. How does JPA work? http://glassfish.java.net/javaee5/persistence/persistence-example.html 6 Markus Eisele, Insurance - Strategic IT-Architecture msg systems ag, 17.10.2011
  • 7. JPA Entities @Entity @Table(name="ORDER_TABLE") public class Order { private int id; @Entity private String address; public class Customer { private Customer customer; private int id; private String name; @Id private Collection<Order> orders; @Column(name="ORDER_ID") public int getId() { @Id return id; public int getId() { return id; } } public void setId(int id) { public void setId(int id) { this.id = id; this.id = id; } } public String getName() { @Column(name="SHIPPING_ADDRESS") return name; public String getAddress() { } return address; public void setName(String name) { } this.name = name; } public void setAddress(String address) { @OneToMany(cascade=ALL, mappedBy="customer") this.address = address; public Collection<Order> getOrders() { } return orders; } @ManyToOne() public void setOrders(Collection<Order> newValue) { @JoinColumn(name="CUSTOMER_ID") this.orders = newValue; public Customer getCustomer() { } return customer; } } public void setCustomer(Customer customer) { this.customer = customer; } } 7 Markus Eisele, Insurance - Strategic IT-Architecture msg systems ag, 17.10.2011
  • 8. Working with the Entity Manager // Create new customer Customer customer0 = new Customer(); customer0.setId(1); customer0.setName("Joe Smith"); // Persist the customer em.persist(customer0); // Associate orders with the customer. customer0.getOrders().add(order1); order1.setCustomer(customer0); // Persist the customer em.persist(customer0); 8 Markus Eisele, Insurance - Strategic IT-Architecture msg systems ag, 17.10.2011
  • 9. What is Coherence? 9 Markus Eisele, Insurance - Strategic IT-Architecture msg systems ag, 17.10.2011
  • 10. How Coherence works 10 Markus Eisele, Insurance - Strategic IT-Architecture msg systems ag, 17.10.2011
  • 11. How Coherence works 11 Markus Eisele, Insurance - Strategic IT-Architecture msg systems ag, 17.10.2011
  • 12. How Coherence works 12 Markus Eisele, Insurance - Strategic IT-Architecture msg systems ag, 17.10.2011
  • 13. How Coherence works • Members have logical access to all Entities  At most 2 network operations per access  At most 4 network operations per update  Regardless of cluster size  Deterministic access and update behaviour 13 Markus Eisele, Insurance - Strategic IT-Architecture msg systems ag, 17.10.2011
  • 14. What is TopLink Grid? • TopLink Grid is a component of Oracle TopLink • TopLink Grid allows Java developers to transparently leverage the power of the Coherence data grid • TopLink Grid combines:  the simplicity of application development using the Java standard Java Persistence API (JPA) with  the scalability and distributed processing power of Oracle’s Coherence Data Grid. 14 Markus Eisele, Insurance - Strategic IT-Architecture msg systems ag, 17.10.2011
  • 15. What is TopLink Grid? • Supports 'JPA on the Grid' Architecture  EclipseLink JPA applications using Coherence as a shared (L2) cache replacement along with configuration for more advanced usage  TopLink Grid integrates EclipseLink JPA and Coherence  Base configuration uses Coherence data grid as distributed shared cache  Updates to Coherence cache immediately available to all cluster nodes  Advanced configurations uses data grid to process queries to avoid database access and decrease database load 15 Markus Eisele, Insurance - Strategic IT-Architecture msg systems ag, 17.10.2011
  • 16. Why Coherence with JPA? • Historical approach to scaling a JPA application  Adding nodes to a cluster  Tuning database performance to reduce query time • Both of these approaches will support scalability but only to a point 16 Markus Eisele, Insurance - Strategic IT-Architecture msg systems ag, 17.10.2011
  • 17. Why Coherence with JPA? • Historical approach to scaling EclipseLink JPA applications into a cluster:  Disable Shared Cache  Each transaction retrieves all required data from the database. Increased database load limits overall scalability but ensures all nodes have latest data.  Memory footprint of application increases as each transaction has a copy of each required Entity  Every transaction pays object construction cost for queried Entities.  Database becomes bottleneck  Cache Coordination  When Entity is modified in one node, other cluster nodes messaged to replicate/invalidate shared cached Entities.  Creation and/or modification of Entity results in message to all other nodes  Messaging latency means that nodes may have stale data for a short period.  Shared cache size limited by heap of each node  Objects shared across transactions to reduce memory footprint 17 Markus Eisele, Insurance - Strategic IT-Architecture msg systems ag, 17.10.2011
  • 18. Strategies for JPA on the grid 18 Markus Eisele, Insurance - Strategic IT-Architecture msg systems ag, 17.10.2011
  • 19. JPA Backed Caches – Traditional Approach • Coherence API with caches backed by a database mapped through JPA. • The grid accesses relational data through JPA CacheLoader and CacheStore implementations. • TopLink Grid provides CacheLoader and CacheStore implementations that are optimized for EclipseLink JPA. (EclipseLinkJPACacheLoader and EclipseLinkJPACacheStore) • Using the standard JPA run-time configuration file persistence.xml and the JPA mapping file orm.xml. • The Coherence cache configuration file coherence-cache-config.xml must be specified to override the default Coherence settings and define the CacheStore caching scheme. 19 Markus Eisele, Insurance - Strategic IT-Architecture msg systems ag, 17.10.2011
  • 20. Using the Traditional Approach // Get the configured Cache NamedCache cache = CacheFactory.getCache("Customer"); //Create a new Customer Customer cust = new Customer(); cust.setFirstName("Markus"); cust.setLastName("Eisele"); cust.setId(1); //Put the Employee into the cache cache.put(1, cust); 20 Markus Eisele, Insurance - Strategic IT-Architecture msg systems ag, 17.10.2011
  • 21. JPA Second Level Cache – Grid Cache • Ensures all nodes have coherent view of data.  Database is always right  Shared Cache is always right—Entities read, modified, or created are available to all cluster members. • Communication is to primary and backup nodes. • Coherence cache size is the sum of the available heap of all members—larger cache size enables longer tenure and better cache hit rate • Can be used with existing applications and all EclipseLink performance features without altering application results 21 Markus Eisele, Insurance - Strategic IT-Architecture msg systems ag, 17.10.2011
  • 22. Using the 2nd Level Cache ... import oracle.eclipselink.coherence.integrated.cache.Coherenc eInterceptor; import org.eclipse.persistence.annotations.CacheInterceptor; ... @Entity @CacheInterceptor(value = CoherenceInterceptor.class) public class Customer implements Serializable { ... } 22 Markus Eisele, Insurance - Strategic IT-Architecture msg systems ag, 17.10.2011
  • 23. Configuring Optimizations • Grid Read (@Customizer(CoherenceReadCustomizer.class)) )  In the Grid Cache configuration, all reads (both pk and non-pk) are executed against the grid (by default).  For Entities that typically:  Need to be highly available  Must have updates written synchronously to the database; database is system of record • Grid Entity (@Customizer(CoherenceReadWriteCustomizer.class))  The Grid Entity configuration is the same as the Grid Read configuration except that all writes are executed against the grid, not the database.  For Entities that typically:  May have updates written asynchronously to the database (if CacheStore configured) 23 Markus Eisele, Insurance - Strategic IT-Architecture msg systems ag, 17.10.2011
  • 24. JPA 2nd Level Cache with JPA Backed Cache • Combining both approaches is possible with some combinations • Grid Entity  Can be optionally used with CacheStore to update the database. • Grid Read  Can be optionally used with CacheLoader. 24 Markus Eisele, Insurance - Strategic IT-Architecture msg systems ag, 17.10.2011
  • 25. Relationship Support • Coherence does not provide support for the serialization of complex graphs across caches.  Coherence serializes objects/object graphs and places the results in to a single cache under a key. • TopLink Grid 11gR1 does support storage of complex graphs of Entities with each Entity type stored in a corresponding Coherence cache.  Relationship information is stored into Coherence  Relationships are reconstituted upon retrieval from Coherence  Lazy and eager relationships are supported  Relationships between Coherence cached and database persisted objects is supported. • TopLink Grid wraps Entities with relationships with a byte code generated Wrapper class when put()ing into Coherence  Wrapper encodes relationship details  Wrapper is stripped off when Entity retrieved from Coherence and relationships are reconstituted  Eager relationships will result is retrieval (from either Coherence or database depending on configuration) of target Entity/Entities • Non-TopLink Grid applications can query Entities from Coherence with Filters and get() wrapped Entities  TopLink Grid serializer must be configured on Cache  Coherence clients can configure auto-unwrapping  Relationships will be null when retrieved by Coherence clients 25 Markus Eisele, Insurance - Strategic IT-Architecture msg systems ag, 17.10.2011
  • 26. Summary • TopLink supports a range of strategies for scaling JPA applications • TopLink Grid integrates EclipseLink JPA with Oracle Coherence to provide:  'JPA on the Grid' functionality to support scaling JPA applications with Coherence  Support for caching Entities with relationships in Coherence • Both TopLink and Coherence are a part of WebLogic Application Grid 26 Markus Eisele, Insurance - Strategic IT-Architecture msg systems ag, 17.10.2011
  • 27. ActiveCache !!! • Watch out for Oracle Active Cache  Combination of Coherence with either WebLogic Server or Oracle GlassFish Server.  Session State Persistence and Management  Accessing Java Persistence API (JPA) Entities in the Data Cache 27 Markus Eisele, Insurance - Strategic IT-Architecture msg systems ag, 17.10.2011
  • 28. Links and Readings http://blog.eisele.net http://www.oracle.com/technetwork/middleware/coherence/overview/index .html http://www.oracle.com/technetwork/middleware/toplink/overview/index.ht ml http://www.oracle.com/technetwork/middleware/toplink/tl-grid-097210.html http://www.eclipselink.org/ http://java.sys-con.com/node/951117 28 Markus Eisele, Insurance - Strategic IT-Architecture msg systems ag, 17.10.2011
  • 29. Disclaimer The thoughts expressed here are the personal opinions of the author and no official statement of the msg systems ag. 29 Markus Eisele, Oracle ACE Director FMW & SOA msg systems ag, 2011
  • 30. Thank you for your attention! Markus Eisele markus.eisele@msg-systems.com www.msg-systems.com www.msg-systems.com 30 Markus Eisele, Insurance - Strategic IT-Architecture msg systems ag, 17.10.2011