SlideShare a Scribd company logo
1 of 54
Download to read offline
Shaun Smith

Scaling Java
Applications with
Oracle Coherence
Leveraging the Power of Data Grids
Speaker


 Product Manager for Oracle TopLink
     Working with object-relational and object-XML
     mapping technology for over 10 years.
     Involved with Coherence/TopLink Integration
 Eclipse Persistence Services Project (EclipseLink)
 Ecosystem Development Lead
 Eclipse Dali JPA Tools Project Co-Lead
 Eclipse Teneo Project Committer



                                                      Nº2
Agenda


 Scaling Challenges for Java Applications

 Coherence Data Grid

 Scaling with Coherence




                                            Nº3
Scaling Challenges




                     Nº4
Types of Application State


 Request State
   Request/Response
   HTTP/RMI
 Conversational (Transient) State
   Spans multiple requests
   Scoped to a single “user”
   HTTP Sessions/Stateless Session Beans
 Persistent (Durable) State
   Permanent durable storage
   Relational Databases
                                           Nº5
Request State Characteristics


 Short lived
   Life span measured in milliseconds to seconds
 Immutable and scoped to a single user
 Almost no way to corrupt state, easy to avoid losing state
 “Stateless” applications are very easy to scale
   Few applications that work with databases are truly
   “stateless”




                                                    Nº6
Conversational State Characteristics


 Longer lived
    Life span measured in seconds to minutes
 Mutable and scoped to a single user
 Not quite single writer, may have to deal with
 simultaneous requests from a user
    Portlets
    Frames
    Multiple clicks
 Load balancing issues: failover/failback/rebalancing
 Often recoverable
    Worst case, by restarting the session
                                                    Nº7
Persistent State Characteristics


 Long lived
   Life span often measured in years
   Often have regulatory requirements
 Mutable and globally shared
   Possible interaction and contention from all users
   Concurrency and data consistency are hard to combine




                                                 Nº8
Scaling Characteristics


 Request State
    Easiest to scale
    Add more hardware to handle extra HTTP/RMI
    connections
 Conversational State
    Sticky Sessions without session replication
       Scales well, but data loss if node fails
    Session replication
       Works well for small - medium applications
       Cluster may be incoherent upon high load
 Persistent State
    Most difficult to scale
    Absolute requirement for data consistency makes
    scaling difficult (but possible)              Nº9
Typical Web Application



       HTTP Sessions


      Service Interfaces
                           Data Store

       Domain Objects


        Data Access



                                        Nº10
Typical Web Application
                           Applications that cannot
                           loose session data may
                           have scaling challenges
       HTTP Sessions          with session state



      Service Interfaces
                                                Data Store

       Domain Objects


        Data Access



                                                             Nº11
Typical Web Application
                           Applications that cannot
                           loose session data may
                           have scaling challenges
       HTTP Sessions          with session state



      Service Interfaces
                                                Data Store

       Domain Objects
                                                   Scaling the
                                               application tier may
        Data Access                            cause the database
                                                to be a scalability
                                                    bottleneck


                                                             Nº12
Data Grid




            Nº13
Introducing the Data Grid


 Data Management & Clustering Solution
 Live, transactional data in-memory
 Automatic partitioning of application data
 Single holistic view of application data
 Ability to search, analyze, process information




                                                   Nº14
Oracle Coherence Data Grid


 Communication via unicast UDP
 Specialized protocol maintains cluster membership and
 data partitioning
 No single point of failure
 True peer to peer system




                                                  Nº15
Partitioned Topology: Data Access


 Data spread and
 backed up across
 nodes
 Transparent to
 developer
 Members have access
 to all data
 All data locations are
 known - no lookups &
 no registry


                                    Nº16
Partitioned Topology: Data Update


 Synchronous Update
 Avoids potential data
 loss & corruption
 Predictable
 performance
 Backup partitions are
 partitioned away from
 primaries for resilience
 No engineering
 requirement to setup
 primaries or backups

                                    Nº17
Partitioned Topology: Recovery


 Membership changes
 (members added or
 removed)
 Other members, in
 parallel,
 recover/repartition
 No in-flight operations
 lost
 Some latency due to
 higher priority of
 recovery
                                 Nº18
Using Coherence




                  Nº19
Cache Interfaces


    Map, CacheMap,   Traditional Map interface,
    ConcurrentMap    also includes concurrency
                     control (lock, unlock)
    ObservableMap    Real-time events based on
                     filters for insert, update,
                     delete
    QueryMap         Allows for query-based
                     access to cache entries,
                     which can be executed in
                     parallel across the grid
    InvocableMap     Execute processors against
                     cache entries in the nodes
                     responsible for storage (also
                     can be executed in parallel
                                                Nº20
Traditional Map Interface


 Implements Map interface
   Drop in replacement. Full concurrency control.
   Multi-threaded. Scalable and resilient!
     get, put, putAll, size, clear,
    lock, unlock…

 Implements JCache interface
   Extensive support for a multitude of expiration
   policies, including none!

 More than “just a Cache”. More than “just a Map”
                                                     Nº21
Clustered Hello World…


 public static void main(String[] args)
           throws IOException {
    NamedCache nc = CacheFactory.getCache(“test”);
    nc.put(“message”, “Hello World”);
    System.out.println(nc.get(“message”));

     System.in.read();
 }
 Joins / Establishes a cluster
 Places an Entry (key, value) into the Cache “test” (notice no configuration)
 Retrieves the Entry from the Cache.
 Displays it.
 “read” at the end to keep the application (and Cluster) from terminating.

                                                                    Nº22
Clustered Hello World…


 public static void main(String[] args) throws
           IOException {
    NamedCache nc = CacheFactory.getCache(“test”);
    System.out.println(nc.get(“message”));
 }



 Joins / Establishes a cluster
 Retrieves the Entry from the Cache.
 Displays it
 Start as many applications as you like… they all cluster the are able to
 share the values in the cache


                                                                     Nº23
Demo




       Nº24
Observable Interface


 Real-time filterable (bean) events for entry insert, update, delete
 Filters applied in parallel (in the Grid)
 Filters completely extensible
 A large range of filters out-of-the-box:
    All, Always, And, Any, Array, Between, Class,
    Comparison, ContainsAll, ContainsAny, Contains,
    Equals, GreaterEquals, Greater, In, InKeySet,
    IsNotNull, IsNull, LessEquals, Less, Like, Limit,
    Never, NotEquals, Not, Or, Present, Xor…
 Events may be synchronous
      – trades.addMapListener(
        new StockEventFilter(“ORCL”),
        new MyMapListener(…));


                                                              Nº25
Observable Interface




                       Nº26
QueryMap Interface


 Find Keys or Values that satisfy a Filter.
    entrySet(…), keySet(…)

 Define indexes (on-the-fly) to extract and index any part
 of an Entry

 Executed in Parallel

 Create Continuous View of entries based on a Filter with
 real-time events dispatch
    Perfect for client applications “watching” data
                                                   Nº27
Features : QueryMap Interface




                                Nº28
Demo




       Nº29
Features : InvocableMap Interface


  Execute processors against an Entry, a Collection or a Filter
  Executions occur in parallel (aka: Grid-style)
  No “workers” to manage!

  Processors may return any value
      – trades.invokeAll(
         new EqualsFilter(“getSecurity”,“ORCL”),
         new StockSplit(2.0));

  Aggregate Entries based on a Filter
      – positions.aggregate(
        new EqualsFilter(“getSecurity”,“ORCL”),
        new SumFilter(“amount”));

                                                                  Nº30
Features : InvocableMap Interface




                                    Nº31
Scaling with Coherence




                         Nº32
Scaling Java Applications


 Conversational State
   User sessions
   Application State
 Persistent State
   Cache access patterns
   Data Grid as System of Record (SoR)




                                         Nº33
Scaling the Conversational State


 Normally, session data that cannot be lost is saved in a
 database
 As a result, application scalability is limited to database
 scalability
 Session data can be stored in a Data Grid instead
 Get the best of both worlds
   Performance of in-memory access
   Data consistency of a database



                                                      Nº34
Scaling the Conversational State


 Coherence*Web is an out-of-the-box solution for reliably
 scaling HTTP sessions
 No coding required; simply run the instrumentation
 program on pre-existing WAR files
 Support for popular web containers
   WebLogic
   WebSphere
   OC4J
   Tomcat
   Jetty

                                                   Nº35
Scaling the Persistent State


 Scaling the data tier along with the application tier is a
 challenge with Java applications
 Data Grids can help applications scale the data tier
   Simple
      Caching read-only data
   Intermediate
      Caching read-write data
   Advanced
      Transactional caching
      Data Grid is System of Record (SoR)


                                                      Nº36
Cache Access Patterns


 ORM L2
 Cache Aside
 Read Through
 Write Through
 Write Behind




                        Nº37
ORM L2 Cache


 Configure ORM to cache database data

        Domain Objects


          Data Access


             ORM                    Data Store

             Cache

                                                 Nº38
ORM L2 Cache



 Advantages
   Requires little to no coding
 Disadvantages
   Caching database data incurs cost of object building
   Data Grid capabilities cannot be used, Data Grid
   becomes a regular cache




                                                 Nº39
Cache Aside


 Cache Aside pattern means the developer manages the
 contents of the cache manually

        Domain Objects


          Data Access               Cache




              ORM                Data Store

                                               Nº40
Cache Aside


 Requires the following:
   Check the cache before reading from data source
   Put data into cache after reading from data source
   Evict or update cache when updating data source
 Cache Aside can be written as a core part of the
 application logic, or it can be a cross cutting concern if
 the data access method is generic




                                                      Nº41
Cache Aside


 Advantages
    Developer has full control over data access operations
 Disadvantages
    Data Grid features may be harder to use with this
    architecture; it may be used only as a cache




                                                    Nº42
Read Through


 Cache is in between Data Access and Data Source
 Data access must happen through the cache
 If there is a cache miss, the cache will load the data from
 the database automatically




                                                     Nº43
Read/Write Through




      Data Access                 Cache Server



      Cache Client                   ORM




                     Data Store

                                                 Nº44
Read Through


 Advantages
    Concurrent access operations are handled
    automatically (only one SELECT issued to the
    database), thus reducing database load
    Seamless integration with cache
 Disadvantages
    Data is only loaded when object is requested by key
    (instead of by query)




                                                  Nº45
Write Through


 Like Read Through, cache sits between Data Access and
 Data Source
 Updates to the cache are written synchronously to the
 database
 Advantages
    Seamless integration with cache
    Write to cache can be rolled back upon database error
 Disadvantages
    Write performance can only scale as far as the
    database will allow

                                                   Nº46
Write Behind


 Similar to Write Through
 Writes are queued up and executed asynchronously
 Data Grid is System of Record (SoR)




                                                Nº47
Write Behind




      Data Access                 Cache Server

                                           Queue

      Cache Client                   ORM




                     Data Store

                                                 Nº48
Write Behind


 Advantages
    Scalability is no longer limited to the database
    Provides much greater scalability and performance for
    write heavy applications
    Application can continue to function upon database
    failure
 Disadvantages
    Data in queue is not disk durable (but data is durable
    in case of a server failure)
    In the (unlikely) event of an entire cluster failure,
    there will be data loss

                                                   Nº49
TopLink CacheLoader & CacheStore


 Coherence 3.3 includes TopLink Essentials JPA
 CacheLoader and CacheStore
 Coherence will support Oracle TopLink and EclipseLink
 CacheLoader and CacheStore in upcoming release.




                                                 Nº50
Typical Web Application




     HTTP Sessions


    Service Interfaces
                          Data Store

     Domain Objects


      Data Access


                                       Nº51
Web Application using Data Grid




     HTTP Sessions


    Service Interfaces
                           Data
                           Grid   Data Store
     Domain Objects


      Data Access


                                         Nº52
Conclusion


 The most difficult scaling challenges are providing data access
 for stateful applications across a cluster/grid
 Using a Data Grid such as Coherence, Java applications can
 enjoy reliable, fast, and linearly scaleable data access
 Coherence can send the processing to the data—instead of the
 data to the processing—to support parallel processing that
 greatly improves system throughput

     Coherence provides a simple reliable approach to scaling
     Java applications




                                                         Nº53
Q&A




      Nº54

More Related Content

Similar to Smith Scaling Java Applications With Coherence

GemFire In Memory Data Grid
GemFire In Memory Data GridGemFire In Memory Data Grid
GemFire In Memory Data GridDmitry Buzdin
 
Availability Considerations for SQL Server
Availability Considerations for SQL ServerAvailability Considerations for SQL Server
Availability Considerations for SQL ServerBob Roudebush
 
Oracle Coherence: in-memory datagrid
Oracle Coherence: in-memory datagridOracle Coherence: in-memory datagrid
Oracle Coherence: in-memory datagridEmiliano Pecis
 
Web Oriented Architecture at Oracle
Web Oriented Architecture at OracleWeb Oriented Architecture at Oracle
Web Oriented Architecture at OracleEmiliano Pecis
 
Oracle 10g rac_overview
Oracle 10g rac_overviewOracle 10g rac_overview
Oracle 10g rac_overviewRobel Parvini
 
Atmosphere 2014: Switching from monolithic approach to modular cloud computin...
Atmosphere 2014: Switching from monolithic approach to modular cloud computin...Atmosphere 2014: Switching from monolithic approach to modular cloud computin...
Atmosphere 2014: Switching from monolithic approach to modular cloud computin...PROIDEA
 
Stephane Lapointe & Alexandre Brisebois: Développer des microservices avec Se...
Stephane Lapointe & Alexandre Brisebois: Développer des microservices avec Se...Stephane Lapointe & Alexandre Brisebois: Développer des microservices avec Se...
Stephane Lapointe & Alexandre Brisebois: Développer des microservices avec Se...MSDEVMTL
 
Zou Layered VO PDCAT2008 V0.5 Concise
Zou Layered VO PDCAT2008 V0.5 ConciseZou Layered VO PDCAT2008 V0.5 Concise
Zou Layered VO PDCAT2008 V0.5 Conciseyongqiangzou
 
Java ee7 with apache spark for the world's largest credit card core systems, ...
Java ee7 with apache spark for the world's largest credit card core systems, ...Java ee7 with apache spark for the world's largest credit card core systems, ...
Java ee7 with apache spark for the world's largest credit card core systems, ...Rakuten Group, Inc.
 
Architecting and Tuning IIB/eXtreme Scale for Maximum Performance and Reliabi...
Architecting and Tuning IIB/eXtreme Scale for Maximum Performance and Reliabi...Architecting and Tuning IIB/eXtreme Scale for Maximum Performance and Reliabi...
Architecting and Tuning IIB/eXtreme Scale for Maximum Performance and Reliabi...Prolifics
 
Big Data LDN 2016: Kick Start your Big Data project with Hyperconverged Infra...
Big Data LDN 2016: Kick Start your Big Data project with Hyperconverged Infra...Big Data LDN 2016: Kick Start your Big Data project with Hyperconverged Infra...
Big Data LDN 2016: Kick Start your Big Data project with Hyperconverged Infra...Matt Stubbs
 
Apache Kafka® and the Data Mesh
Apache Kafka® and the Data MeshApache Kafka® and the Data Mesh
Apache Kafka® and the Data MeshConfluentInc1
 
Disaster Recovery Experience at CACIB: Hardening Hadoop for Critical Financia...
Disaster Recovery Experience at CACIB: Hardening Hadoop for Critical Financia...Disaster Recovery Experience at CACIB: Hardening Hadoop for Critical Financia...
Disaster Recovery Experience at CACIB: Hardening Hadoop for Critical Financia...DataWorks Summit
 
Server Farms and XML Web Services
Server Farms and XML Web ServicesServer Farms and XML Web Services
Server Farms and XML Web ServicesJorgen Thelin
 

Similar to Smith Scaling Java Applications With Coherence (20)

GemFire In-Memory Data Grid
GemFire In-Memory Data GridGemFire In-Memory Data Grid
GemFire In-Memory Data Grid
 
GemFire In Memory Data Grid
GemFire In Memory Data GridGemFire In Memory Data Grid
GemFire In Memory Data Grid
 
Oracle Coherence
Oracle CoherenceOracle Coherence
Oracle Coherence
 
Clustering van IT-componenten
Clustering van IT-componentenClustering van IT-componenten
Clustering van IT-componenten
 
Availability Considerations for SQL Server
Availability Considerations for SQL ServerAvailability Considerations for SQL Server
Availability Considerations for SQL Server
 
Oracle Coherence: in-memory datagrid
Oracle Coherence: in-memory datagridOracle Coherence: in-memory datagrid
Oracle Coherence: in-memory datagrid
 
Web Oriented Architecture at Oracle
Web Oriented Architecture at OracleWeb Oriented Architecture at Oracle
Web Oriented Architecture at Oracle
 
Oracle 10g rac_overview
Oracle 10g rac_overviewOracle 10g rac_overview
Oracle 10g rac_overview
 
Rain technology seminar
Rain technology seminar Rain technology seminar
Rain technology seminar
 
Mres presentation
Mres presentationMres presentation
Mres presentation
 
Atmosphere 2014: Switching from monolithic approach to modular cloud computin...
Atmosphere 2014: Switching from monolithic approach to modular cloud computin...Atmosphere 2014: Switching from monolithic approach to modular cloud computin...
Atmosphere 2014: Switching from monolithic approach to modular cloud computin...
 
Azure and cloud design patterns
Azure and cloud design patternsAzure and cloud design patterns
Azure and cloud design patterns
 
Stephane Lapointe & Alexandre Brisebois: Développer des microservices avec Se...
Stephane Lapointe & Alexandre Brisebois: Développer des microservices avec Se...Stephane Lapointe & Alexandre Brisebois: Développer des microservices avec Se...
Stephane Lapointe & Alexandre Brisebois: Développer des microservices avec Se...
 
Zou Layered VO PDCAT2008 V0.5 Concise
Zou Layered VO PDCAT2008 V0.5 ConciseZou Layered VO PDCAT2008 V0.5 Concise
Zou Layered VO PDCAT2008 V0.5 Concise
 
Java ee7 with apache spark for the world's largest credit card core systems, ...
Java ee7 with apache spark for the world's largest credit card core systems, ...Java ee7 with apache spark for the world's largest credit card core systems, ...
Java ee7 with apache spark for the world's largest credit card core systems, ...
 
Architecting and Tuning IIB/eXtreme Scale for Maximum Performance and Reliabi...
Architecting and Tuning IIB/eXtreme Scale for Maximum Performance and Reliabi...Architecting and Tuning IIB/eXtreme Scale for Maximum Performance and Reliabi...
Architecting and Tuning IIB/eXtreme Scale for Maximum Performance and Reliabi...
 
Big Data LDN 2016: Kick Start your Big Data project with Hyperconverged Infra...
Big Data LDN 2016: Kick Start your Big Data project with Hyperconverged Infra...Big Data LDN 2016: Kick Start your Big Data project with Hyperconverged Infra...
Big Data LDN 2016: Kick Start your Big Data project with Hyperconverged Infra...
 
Apache Kafka® and the Data Mesh
Apache Kafka® and the Data MeshApache Kafka® and the Data Mesh
Apache Kafka® and the Data Mesh
 
Disaster Recovery Experience at CACIB: Hardening Hadoop for Critical Financia...
Disaster Recovery Experience at CACIB: Hardening Hadoop for Critical Financia...Disaster Recovery Experience at CACIB: Hardening Hadoop for Critical Financia...
Disaster Recovery Experience at CACIB: Hardening Hadoop for Critical Financia...
 
Server Farms and XML Web Services
Server Farms and XML Web ServicesServer Farms and XML Web Services
Server Farms and XML Web Services
 

More from Snoop Consulting

More from Snoop Consulting (8)

SOA - IBM
SOA - IBMSOA - IBM
SOA - IBM
 
Presentación Snoop Mysql
Presentación Snoop MysqlPresentación Snoop Mysql
Presentación Snoop Mysql
 
My Sql Presentation
My Sql PresentationMy Sql Presentation
My Sql Presentation
 
Golombek La Ciencia En La Vida
Golombek   La Ciencia En La VidaGolombek   La Ciencia En La Vida
Golombek La Ciencia En La Vida
 
Ambrosi 2 Aprendiendo Con Los Datos Update08
Ambrosi 2 Aprendiendo Con Los Datos Update08Ambrosi 2 Aprendiendo Con Los Datos Update08
Ambrosi 2 Aprendiendo Con Los Datos Update08
 
Update08 Web2
Update08 Web2Update08 Web2
Update08 Web2
 
Update08 Web2.0 Design Patterns V1.0
Update08 Web2.0 Design Patterns V1.0Update08 Web2.0 Design Patterns V1.0
Update08 Web2.0 Design Patterns V1.0
 
Agildistendidoyeficiente
AgildistendidoyeficienteAgildistendidoyeficiente
Agildistendidoyeficiente
 

Recently uploaded

#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 

Recently uploaded (20)

#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 

Smith Scaling Java Applications With Coherence

  • 1. Shaun Smith Scaling Java Applications with Oracle Coherence Leveraging the Power of Data Grids
  • 2. Speaker Product Manager for Oracle TopLink Working with object-relational and object-XML mapping technology for over 10 years. Involved with Coherence/TopLink Integration Eclipse Persistence Services Project (EclipseLink) Ecosystem Development Lead Eclipse Dali JPA Tools Project Co-Lead Eclipse Teneo Project Committer Nº2
  • 3. Agenda Scaling Challenges for Java Applications Coherence Data Grid Scaling with Coherence Nº3
  • 5. Types of Application State Request State Request/Response HTTP/RMI Conversational (Transient) State Spans multiple requests Scoped to a single “user” HTTP Sessions/Stateless Session Beans Persistent (Durable) State Permanent durable storage Relational Databases Nº5
  • 6. Request State Characteristics Short lived Life span measured in milliseconds to seconds Immutable and scoped to a single user Almost no way to corrupt state, easy to avoid losing state “Stateless” applications are very easy to scale Few applications that work with databases are truly “stateless” Nº6
  • 7. Conversational State Characteristics Longer lived Life span measured in seconds to minutes Mutable and scoped to a single user Not quite single writer, may have to deal with simultaneous requests from a user Portlets Frames Multiple clicks Load balancing issues: failover/failback/rebalancing Often recoverable Worst case, by restarting the session Nº7
  • 8. Persistent State Characteristics Long lived Life span often measured in years Often have regulatory requirements Mutable and globally shared Possible interaction and contention from all users Concurrency and data consistency are hard to combine Nº8
  • 9. Scaling Characteristics Request State Easiest to scale Add more hardware to handle extra HTTP/RMI connections Conversational State Sticky Sessions without session replication Scales well, but data loss if node fails Session replication Works well for small - medium applications Cluster may be incoherent upon high load Persistent State Most difficult to scale Absolute requirement for data consistency makes scaling difficult (but possible) Nº9
  • 10. Typical Web Application HTTP Sessions Service Interfaces Data Store Domain Objects Data Access Nº10
  • 11. Typical Web Application Applications that cannot loose session data may have scaling challenges HTTP Sessions with session state Service Interfaces Data Store Domain Objects Data Access Nº11
  • 12. Typical Web Application Applications that cannot loose session data may have scaling challenges HTTP Sessions with session state Service Interfaces Data Store Domain Objects Scaling the application tier may Data Access cause the database to be a scalability bottleneck Nº12
  • 13. Data Grid Nº13
  • 14. Introducing the Data Grid Data Management & Clustering Solution Live, transactional data in-memory Automatic partitioning of application data Single holistic view of application data Ability to search, analyze, process information Nº14
  • 15. Oracle Coherence Data Grid Communication via unicast UDP Specialized protocol maintains cluster membership and data partitioning No single point of failure True peer to peer system Nº15
  • 16. Partitioned Topology: Data Access Data spread and backed up across nodes Transparent to developer Members have access to all data All data locations are known - no lookups & no registry Nº16
  • 17. Partitioned Topology: Data Update Synchronous Update Avoids potential data loss & corruption Predictable performance Backup partitions are partitioned away from primaries for resilience No engineering requirement to setup primaries or backups Nº17
  • 18. Partitioned Topology: Recovery Membership changes (members added or removed) Other members, in parallel, recover/repartition No in-flight operations lost Some latency due to higher priority of recovery Nº18
  • 20. Cache Interfaces Map, CacheMap, Traditional Map interface, ConcurrentMap also includes concurrency control (lock, unlock) ObservableMap Real-time events based on filters for insert, update, delete QueryMap Allows for query-based access to cache entries, which can be executed in parallel across the grid InvocableMap Execute processors against cache entries in the nodes responsible for storage (also can be executed in parallel Nº20
  • 21. Traditional Map Interface Implements Map interface Drop in replacement. Full concurrency control. Multi-threaded. Scalable and resilient! get, put, putAll, size, clear, lock, unlock… Implements JCache interface Extensive support for a multitude of expiration policies, including none! More than “just a Cache”. More than “just a Map” Nº21
  • 22. Clustered Hello World… public static void main(String[] args) throws IOException { NamedCache nc = CacheFactory.getCache(“test”); nc.put(“message”, “Hello World”); System.out.println(nc.get(“message”)); System.in.read(); } Joins / Establishes a cluster Places an Entry (key, value) into the Cache “test” (notice no configuration) Retrieves the Entry from the Cache. Displays it. “read” at the end to keep the application (and Cluster) from terminating. Nº22
  • 23. Clustered Hello World… public static void main(String[] args) throws IOException { NamedCache nc = CacheFactory.getCache(“test”); System.out.println(nc.get(“message”)); } Joins / Establishes a cluster Retrieves the Entry from the Cache. Displays it Start as many applications as you like… they all cluster the are able to share the values in the cache Nº23
  • 24. Demo Nº24
  • 25. Observable Interface Real-time filterable (bean) events for entry insert, update, delete Filters applied in parallel (in the Grid) Filters completely extensible A large range of filters out-of-the-box: All, Always, And, Any, Array, Between, Class, Comparison, ContainsAll, ContainsAny, Contains, Equals, GreaterEquals, Greater, In, InKeySet, IsNotNull, IsNull, LessEquals, Less, Like, Limit, Never, NotEquals, Not, Or, Present, Xor… Events may be synchronous – trades.addMapListener( new StockEventFilter(“ORCL”), new MyMapListener(…)); Nº25
  • 27. QueryMap Interface Find Keys or Values that satisfy a Filter. entrySet(…), keySet(…) Define indexes (on-the-fly) to extract and index any part of an Entry Executed in Parallel Create Continuous View of entries based on a Filter with real-time events dispatch Perfect for client applications “watching” data Nº27
  • 28. Features : QueryMap Interface Nº28
  • 29. Demo Nº29
  • 30. Features : InvocableMap Interface Execute processors against an Entry, a Collection or a Filter Executions occur in parallel (aka: Grid-style) No “workers” to manage! Processors may return any value – trades.invokeAll( new EqualsFilter(“getSecurity”,“ORCL”), new StockSplit(2.0)); Aggregate Entries based on a Filter – positions.aggregate( new EqualsFilter(“getSecurity”,“ORCL”), new SumFilter(“amount”)); Nº30
  • 31. Features : InvocableMap Interface Nº31
  • 33. Scaling Java Applications Conversational State User sessions Application State Persistent State Cache access patterns Data Grid as System of Record (SoR) Nº33
  • 34. Scaling the Conversational State Normally, session data that cannot be lost is saved in a database As a result, application scalability is limited to database scalability Session data can be stored in a Data Grid instead Get the best of both worlds Performance of in-memory access Data consistency of a database Nº34
  • 35. Scaling the Conversational State Coherence*Web is an out-of-the-box solution for reliably scaling HTTP sessions No coding required; simply run the instrumentation program on pre-existing WAR files Support for popular web containers WebLogic WebSphere OC4J Tomcat Jetty Nº35
  • 36. Scaling the Persistent State Scaling the data tier along with the application tier is a challenge with Java applications Data Grids can help applications scale the data tier Simple Caching read-only data Intermediate Caching read-write data Advanced Transactional caching Data Grid is System of Record (SoR) Nº36
  • 37. Cache Access Patterns ORM L2 Cache Aside Read Through Write Through Write Behind Nº37
  • 38. ORM L2 Cache Configure ORM to cache database data Domain Objects Data Access ORM Data Store Cache Nº38
  • 39. ORM L2 Cache Advantages Requires little to no coding Disadvantages Caching database data incurs cost of object building Data Grid capabilities cannot be used, Data Grid becomes a regular cache Nº39
  • 40. Cache Aside Cache Aside pattern means the developer manages the contents of the cache manually Domain Objects Data Access Cache ORM Data Store Nº40
  • 41. Cache Aside Requires the following: Check the cache before reading from data source Put data into cache after reading from data source Evict or update cache when updating data source Cache Aside can be written as a core part of the application logic, or it can be a cross cutting concern if the data access method is generic Nº41
  • 42. Cache Aside Advantages Developer has full control over data access operations Disadvantages Data Grid features may be harder to use with this architecture; it may be used only as a cache Nº42
  • 43. Read Through Cache is in between Data Access and Data Source Data access must happen through the cache If there is a cache miss, the cache will load the data from the database automatically Nº43
  • 44. Read/Write Through Data Access Cache Server Cache Client ORM Data Store Nº44
  • 45. Read Through Advantages Concurrent access operations are handled automatically (only one SELECT issued to the database), thus reducing database load Seamless integration with cache Disadvantages Data is only loaded when object is requested by key (instead of by query) Nº45
  • 46. Write Through Like Read Through, cache sits between Data Access and Data Source Updates to the cache are written synchronously to the database Advantages Seamless integration with cache Write to cache can be rolled back upon database error Disadvantages Write performance can only scale as far as the database will allow Nº46
  • 47. Write Behind Similar to Write Through Writes are queued up and executed asynchronously Data Grid is System of Record (SoR) Nº47
  • 48. Write Behind Data Access Cache Server Queue Cache Client ORM Data Store Nº48
  • 49. Write Behind Advantages Scalability is no longer limited to the database Provides much greater scalability and performance for write heavy applications Application can continue to function upon database failure Disadvantages Data in queue is not disk durable (but data is durable in case of a server failure) In the (unlikely) event of an entire cluster failure, there will be data loss Nº49
  • 50. TopLink CacheLoader & CacheStore Coherence 3.3 includes TopLink Essentials JPA CacheLoader and CacheStore Coherence will support Oracle TopLink and EclipseLink CacheLoader and CacheStore in upcoming release. Nº50
  • 51. Typical Web Application HTTP Sessions Service Interfaces Data Store Domain Objects Data Access Nº51
  • 52. Web Application using Data Grid HTTP Sessions Service Interfaces Data Grid Data Store Domain Objects Data Access Nº52
  • 53. Conclusion The most difficult scaling challenges are providing data access for stateful applications across a cluster/grid Using a Data Grid such as Coherence, Java applications can enjoy reliable, fast, and linearly scaleable data access Coherence can send the processing to the data—instead of the data to the processing—to support parallel processing that greatly improves system throughput Coherence provides a simple reliable approach to scaling Java applications Nº53
  • 54. Q&A Nº54