SlideShare ist ein Scribd-Unternehmen logo
1 von 49
Clustering Made Easier Using Terracotta with Hibernate and/or Ehcache Cris J. Holdorph Software Architect Unicon, Inc. Jasig Conference San Diego, CA March 9, 2010 © Copyright Unicon, Inc., 2008.  Some rights reserved.  This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License. To view a copy of this license, visit  http://creativecommons.org/licenses/by-nc-sa/3.0/us/
Speaker Bio ,[object Object]
Java Developer since 1997
Unicon Employee since 1998 ,[object Object]
uPortal
Sakai
Miscellaneous Professional Services ,[object Object]
Agenda ,[object Object]
Using Ehcache
Using Ehcache with Terracotta
Using Hibernate
Using Hibernate with 2cd level cache
Terracotta Server
Other Considerations
Technologies
Technologies ,[object Object]
Hibernate
Terracotta
Spring Framework
Ehcache ,[object Object]
Used by both uPortal and Sakai
Hibernate ,[object Object]
JPA implementation ,[object Object],[object Object],[object Object]
Used by both uPortal and Sakai
Terracotta ,[object Object]
Clustered Caching Platform
Network Attached Memory ,[object Object],[object Object],[object Object]
Open Source and Commercial
Unicon Partner
Many Terracotta employees are avid Twitter users
Spring Framework ,[object Object]
Multipurpose Java development libraries
And more... ,[object Object],[object Object],[object Object]
Strong integration with Ehcache, Hibernate
Some integration with Terracotta
Used by both uPortal and Sakai
Using Ehcache
Sample Application ,[object Object]
Form View ,[object Object]
Sample Application (screenshots)
Sample Application (screenshots)
pom.xml <dependency> <groupId>net.sf.ehcache</groupId> <artifactId>ehcache-core</artifactId> <version>1.7.2</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-jdk14</artifactId> <version>1.5.8</version> </dependency>
ehcache.xml <ehcache> <diskStore path=&quot;java.io.tmpdir&quot; /> <defaultCache maxElementsInMemory=&quot;10&quot; eternal=&quot;false&quot; timeToIdleSeconds=&quot;120&quot; timeToLiveSeconds=&quot;300&quot; overflowToDisk=&quot;true&quot; /> <cache name=&quot;PEOPLE_CACHE&quot; maxElementsInMemory=&quot;2000&quot; eternal=&quot;false&quot; overflowToDisk=&quot;true&quot; timeToIdleSeconds=&quot;0&quot; timeToLiveSeconds=&quot;3600&quot; /> </ehcache>
CensusCollectServlet.java import net.sf.ehcache.Cache; import net.sf.ehcache.CacheManager; import net.sf.ehcache.Element; … private Cache peopleCache = null; … public void init(ServletConfig config) throws ServletException { super.init(config); CacheManager manager = new CacheManager(); peopleCache = manager.getCache(&quot;PEOPLE_CACHE&quot;); } ...
CensusCollectServlet.java ... Person person = null; Element element = peopleCache.get(ssn); if (person == null) { person = new Person(); } else { person = (Person)element.getValue(); } request.setAttribute(PERSON, person); ... peopleCache.put(new Element(ssn, person)); ...
Using Ehcache with RMI Replication
ehcache.xml <cacheManagerPeerProviderFactory class=&quot;net.sf.ehcache.distribution. RMICacheManagerPeerProviderFactory&quot; properties=&quot;hostName=fully_qualified_hostname_or_ip, peerDiscovery=automatic, multicastGroupAddress=230.0.0.1, multicastGroupPort=4446, timeToLive=32&quot;/> <cache name=&quot; PEOPLE_CACHE &quot; ...> <cacheEventListenerFactory class=&quot;net.sf.ehcache.distribution.RMICacheReplicatorFactory” properties=&quot;replicateAsynchronously=true, replicatePuts=true, replicatePutsViaCopy=false, replicateUpdates=true, replicateUpdatesViaCopy=true, replicateRemovals=true asynchronousReplicationIntervalMillis=1000&quot;/> </cache>
Using Ehcache with Terracotta
pom.xml <dependency> <groupId>net.sf.ehcache</groupId> <artifactId>ehcache-core</artifactId> <version>1.7.2</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-jdk14</artifactId> <version>1.5.8</version> </dependency> <dependency> <groupId>net.sf.ehcache</groupId> <artifactId>ehcache-terracotta</artifactId> <version>1.8.0</version> </dependency>

Weitere ähnliche Inhalte

Was ist angesagt?

How to Implement Token Authentication Using the Django REST Framework
How to Implement Token Authentication Using the Django REST FrameworkHow to Implement Token Authentication Using the Django REST Framework
How to Implement Token Authentication Using the Django REST FrameworkKaty Slemon
 
Construire son JDK en 10 étapes
Construire son JDK en 10 étapesConstruire son JDK en 10 étapes
Construire son JDK en 10 étapesJosé Paumard
 
WebRTC 101 - How to get started building your first WebRTC application
WebRTC 101 - How to get started building your first WebRTC applicationWebRTC 101 - How to get started building your first WebRTC application
WebRTC 101 - How to get started building your first WebRTC applicationDan Jenkins
 
[CB16] Esoteric Web Application Vulnerabilities by Andrés Riancho
[CB16] Esoteric Web Application Vulnerabilities by Andrés Riancho[CB16] Esoteric Web Application Vulnerabilities by Andrés Riancho
[CB16] Esoteric Web Application Vulnerabilities by Andrés RianchoCODE BLUE
 
Mobile Device APIs
Mobile Device APIsMobile Device APIs
Mobile Device APIsJames Pearce
 
OSXCollector: Automated forensic evidence collection & analysis for OS X (Bru...
OSXCollector: Automated forensic evidence collection & analysis for OS X (Bru...OSXCollector: Automated forensic evidence collection & analysis for OS X (Bru...
OSXCollector: Automated forensic evidence collection & analysis for OS X (Bru...Jakub "Kuba" Sendor
 
V2 peter-lubbers-sf-jug-websocket
V2 peter-lubbers-sf-jug-websocketV2 peter-lubbers-sf-jug-websocket
V2 peter-lubbers-sf-jug-websocketbrent bucci
 
Craft 2019 - “The Upside Down” Of The Web - Video technologies
Craft 2019 - “The Upside Down” Of The Web - Video technologiesCraft 2019 - “The Upside Down” Of The Web - Video technologies
Craft 2019 - “The Upside Down” Of The Web - Video technologiesMáté Nádasdi
 
Asynchronous Programming at Netflix
Asynchronous Programming at NetflixAsynchronous Programming at Netflix
Asynchronous Programming at NetflixC4Media
 
How to create a real time chat application using socket.io, golang, and vue js-
How to create a real time chat application using socket.io, golang, and vue js-How to create a real time chat application using socket.io, golang, and vue js-
How to create a real time chat application using socket.io, golang, and vue js-Katy Slemon
 
2020-02-20 - HashiCorpUserGroup Madring - Integrating HashiCorp Vault and Kub...
2020-02-20 - HashiCorpUserGroup Madring - Integrating HashiCorp Vault and Kub...2020-02-20 - HashiCorpUserGroup Madring - Integrating HashiCorp Vault and Kub...
2020-02-20 - HashiCorpUserGroup Madring - Integrating HashiCorp Vault and Kub...Andrey Devyatkin
 
Reversing & malware analysis training part 3 windows pe file format basics
Reversing & malware analysis training part 3   windows pe file format basicsReversing & malware analysis training part 3   windows pe file format basics
Reversing & malware analysis training part 3 windows pe file format basicssecurityxploded
 
Aplicações HTML5 com Java EE 7 e NetBeans
Aplicações HTML5 com Java EE 7 e NetBeansAplicações HTML5 com Java EE 7 e NetBeans
Aplicações HTML5 com Java EE 7 e NetBeansBruno Borges
 
PuppetConf 2016: Puppet Troubleshooting – Thomas Uphill, Wells Fargo
PuppetConf 2016: Puppet Troubleshooting – Thomas Uphill, Wells FargoPuppetConf 2016: Puppet Troubleshooting – Thomas Uphill, Wells Fargo
PuppetConf 2016: Puppet Troubleshooting – Thomas Uphill, Wells FargoPuppet
 
REST in ( a mobile ) peace @ WHYMCA 05-21-2011
REST in ( a mobile ) peace @ WHYMCA 05-21-2011REST in ( a mobile ) peace @ WHYMCA 05-21-2011
REST in ( a mobile ) peace @ WHYMCA 05-21-2011Alessandro Nadalin
 
PuppetConf 2016: Nice and Secure: Good OpSec Hygiene With Puppet! – Peter Sou...
PuppetConf 2016: Nice and Secure: Good OpSec Hygiene With Puppet! – Peter Sou...PuppetConf 2016: Nice and Secure: Good OpSec Hygiene With Puppet! – Peter Sou...
PuppetConf 2016: Nice and Secure: Good OpSec Hygiene With Puppet! – Peter Sou...Puppet
 
[CB16] 80時間でWebを一周:クロムミウムオートメーションによるスケーラブルなフィンガープリント by Isaac Dawson
[CB16] 80時間でWebを一周:クロムミウムオートメーションによるスケーラブルなフィンガープリント by Isaac Dawson[CB16] 80時間でWebを一周:クロムミウムオートメーションによるスケーラブルなフィンガープリント by Isaac Dawson
[CB16] 80時間でWebを一周:クロムミウムオートメーションによるスケーラブルなフィンガープリント by Isaac DawsonCODE BLUE
 

Was ist angesagt? (20)

How to Implement Token Authentication Using the Django REST Framework
How to Implement Token Authentication Using the Django REST FrameworkHow to Implement Token Authentication Using the Django REST Framework
How to Implement Token Authentication Using the Django REST Framework
 
Construire son JDK en 10 étapes
Construire son JDK en 10 étapesConstruire son JDK en 10 étapes
Construire son JDK en 10 étapes
 
Maven 3.0 at Øredev
Maven 3.0 at ØredevMaven 3.0 at Øredev
Maven 3.0 at Øredev
 
WebRTC 101 - How to get started building your first WebRTC application
WebRTC 101 - How to get started building your first WebRTC applicationWebRTC 101 - How to get started building your first WebRTC application
WebRTC 101 - How to get started building your first WebRTC application
 
[CB16] Esoteric Web Application Vulnerabilities by Andrés Riancho
[CB16] Esoteric Web Application Vulnerabilities by Andrés Riancho[CB16] Esoteric Web Application Vulnerabilities by Andrés Riancho
[CB16] Esoteric Web Application Vulnerabilities by Andrés Riancho
 
Mobile Device APIs
Mobile Device APIsMobile Device APIs
Mobile Device APIs
 
110828recruit agent ws
110828recruit agent ws110828recruit agent ws
110828recruit agent ws
 
OSXCollector: Automated forensic evidence collection & analysis for OS X (Bru...
OSXCollector: Automated forensic evidence collection & analysis for OS X (Bru...OSXCollector: Automated forensic evidence collection & analysis for OS X (Bru...
OSXCollector: Automated forensic evidence collection & analysis for OS X (Bru...
 
V2 peter-lubbers-sf-jug-websocket
V2 peter-lubbers-sf-jug-websocketV2 peter-lubbers-sf-jug-websocket
V2 peter-lubbers-sf-jug-websocket
 
Craft 2019 - “The Upside Down” Of The Web - Video technologies
Craft 2019 - “The Upside Down” Of The Web - Video technologiesCraft 2019 - “The Upside Down” Of The Web - Video technologies
Craft 2019 - “The Upside Down” Of The Web - Video technologies
 
Asynchronous Programming at Netflix
Asynchronous Programming at NetflixAsynchronous Programming at Netflix
Asynchronous Programming at Netflix
 
How to create a real time chat application using socket.io, golang, and vue js-
How to create a real time chat application using socket.io, golang, and vue js-How to create a real time chat application using socket.io, golang, and vue js-
How to create a real time chat application using socket.io, golang, and vue js-
 
URL to HTML
URL to HTMLURL to HTML
URL to HTML
 
2020-02-20 - HashiCorpUserGroup Madring - Integrating HashiCorp Vault and Kub...
2020-02-20 - HashiCorpUserGroup Madring - Integrating HashiCorp Vault and Kub...2020-02-20 - HashiCorpUserGroup Madring - Integrating HashiCorp Vault and Kub...
2020-02-20 - HashiCorpUserGroup Madring - Integrating HashiCorp Vault and Kub...
 
Reversing & malware analysis training part 3 windows pe file format basics
Reversing & malware analysis training part 3   windows pe file format basicsReversing & malware analysis training part 3   windows pe file format basics
Reversing & malware analysis training part 3 windows pe file format basics
 
Aplicações HTML5 com Java EE 7 e NetBeans
Aplicações HTML5 com Java EE 7 e NetBeansAplicações HTML5 com Java EE 7 e NetBeans
Aplicações HTML5 com Java EE 7 e NetBeans
 
PuppetConf 2016: Puppet Troubleshooting – Thomas Uphill, Wells Fargo
PuppetConf 2016: Puppet Troubleshooting – Thomas Uphill, Wells FargoPuppetConf 2016: Puppet Troubleshooting – Thomas Uphill, Wells Fargo
PuppetConf 2016: Puppet Troubleshooting – Thomas Uphill, Wells Fargo
 
REST in ( a mobile ) peace @ WHYMCA 05-21-2011
REST in ( a mobile ) peace @ WHYMCA 05-21-2011REST in ( a mobile ) peace @ WHYMCA 05-21-2011
REST in ( a mobile ) peace @ WHYMCA 05-21-2011
 
PuppetConf 2016: Nice and Secure: Good OpSec Hygiene With Puppet! – Peter Sou...
PuppetConf 2016: Nice and Secure: Good OpSec Hygiene With Puppet! – Peter Sou...PuppetConf 2016: Nice and Secure: Good OpSec Hygiene With Puppet! – Peter Sou...
PuppetConf 2016: Nice and Secure: Good OpSec Hygiene With Puppet! – Peter Sou...
 
[CB16] 80時間でWebを一周:クロムミウムオートメーションによるスケーラブルなフィンガープリント by Isaac Dawson
[CB16] 80時間でWebを一周:クロムミウムオートメーションによるスケーラブルなフィンガープリント by Isaac Dawson[CB16] 80時間でWebを一周:クロムミウムオートメーションによるスケーラブルなフィンガープリント by Isaac Dawson
[CB16] 80時間でWebを一周:クロムミウムオートメーションによるスケーラブルなフィンガープリント by Isaac Dawson
 

Ähnlich wie Cluster Ehcache Hibernate Terracotta Improve App Performance

Terracotta Ch'ti Jug
Terracotta Ch'ti JugTerracotta Ch'ti Jug
Terracotta Ch'ti JugCh'ti JUG
 
Ajax to the Moon
Ajax to the MoonAjax to the Moon
Ajax to the Moondavejohnson
 
Internet Explorer 8 for Developers by Christian Thilmany
Internet Explorer 8 for Developers by Christian ThilmanyInternet Explorer 8 for Developers by Christian Thilmany
Internet Explorer 8 for Developers by Christian ThilmanyChristian Thilmany
 
IMS Learning Tools Interoperability @ UCLA
IMS Learning Tools Interoperability @ UCLAIMS Learning Tools Interoperability @ UCLA
IMS Learning Tools Interoperability @ UCLACharles Severance
 
Teflon - Anti Stick for the browser attack surface
Teflon - Anti Stick for the browser attack surfaceTeflon - Anti Stick for the browser attack surface
Teflon - Anti Stick for the browser attack surfaceSaumil Shah
 
Creating Yahoo Mobile Widgets
Creating Yahoo Mobile WidgetsCreating Yahoo Mobile Widgets
Creating Yahoo Mobile WidgetsRicardo Varela
 
Accelerated Adoption: HTML5 and CSS3 for ASP.NET Developers
Accelerated Adoption: HTML5 and CSS3 for ASP.NET DevelopersAccelerated Adoption: HTML5 and CSS3 for ASP.NET Developers
Accelerated Adoption: HTML5 and CSS3 for ASP.NET DevelopersTodd Anglin
 
GTLAB Installation Tutorial for SciDAC 2009
GTLAB Installation Tutorial for SciDAC 2009GTLAB Installation Tutorial for SciDAC 2009
GTLAB Installation Tutorial for SciDAC 2009marpierc
 
IBM Lotus Notes Domino XPages and XPages for Mobile
IBM Lotus Notes Domino XPages and XPages for MobileIBM Lotus Notes Domino XPages and XPages for Mobile
IBM Lotus Notes Domino XPages and XPages for MobileChris Toohey
 
GTAC: AtomPub, testing your server implementation
GTAC: AtomPub, testing your server implementationGTAC: AtomPub, testing your server implementation
GTAC: AtomPub, testing your server implementationDavid Calavera
 
Slides Aquarium Paris 2008
Slides Aquarium Paris 2008Slides Aquarium Paris 2008
Slides Aquarium Paris 2008julien.ponge
 
10reasons
10reasons10reasons
10reasonsLi Huan
 
Front End Website Optimization
Front End Website OptimizationFront End Website Optimization
Front End Website OptimizationGerard Sychay
 
An Introduction to Solr
An Introduction to SolrAn Introduction to Solr
An Introduction to Solrtomhill
 

Ähnlich wie Cluster Ehcache Hibernate Terracotta Improve App Performance (20)

Terracotta Ch'ti Jug
Terracotta Ch'ti JugTerracotta Ch'ti Jug
Terracotta Ch'ti Jug
 
Ajax to the Moon
Ajax to the MoonAjax to the Moon
Ajax to the Moon
 
Internet Explorer 8 for Developers by Christian Thilmany
Internet Explorer 8 for Developers by Christian ThilmanyInternet Explorer 8 for Developers by Christian Thilmany
Internet Explorer 8 for Developers by Christian Thilmany
 
Demystifying Maven
Demystifying MavenDemystifying Maven
Demystifying Maven
 
IMS Learning Tools Interoperability @ UCLA
IMS Learning Tools Interoperability @ UCLAIMS Learning Tools Interoperability @ UCLA
IMS Learning Tools Interoperability @ UCLA
 
REST dojo Comet
REST dojo CometREST dojo Comet
REST dojo Comet
 
Teflon - Anti Stick for the browser attack surface
Teflon - Anti Stick for the browser attack surfaceTeflon - Anti Stick for the browser attack surface
Teflon - Anti Stick for the browser attack surface
 
Spring Surf 101
Spring Surf 101Spring Surf 101
Spring Surf 101
 
Creating Yahoo Mobile Widgets
Creating Yahoo Mobile WidgetsCreating Yahoo Mobile Widgets
Creating Yahoo Mobile Widgets
 
Accelerated Adoption: HTML5 and CSS3 for ASP.NET Developers
Accelerated Adoption: HTML5 and CSS3 for ASP.NET DevelopersAccelerated Adoption: HTML5 and CSS3 for ASP.NET Developers
Accelerated Adoption: HTML5 and CSS3 for ASP.NET Developers
 
GTLAB Installation Tutorial for SciDAC 2009
GTLAB Installation Tutorial for SciDAC 2009GTLAB Installation Tutorial for SciDAC 2009
GTLAB Installation Tutorial for SciDAC 2009
 
Jsp
JspJsp
Jsp
 
dJango
dJangodJango
dJango
 
IBM Lotus Notes Domino XPages and XPages for Mobile
IBM Lotus Notes Domino XPages and XPages for MobileIBM Lotus Notes Domino XPages and XPages for Mobile
IBM Lotus Notes Domino XPages and XPages for Mobile
 
GTAC: AtomPub, testing your server implementation
GTAC: AtomPub, testing your server implementationGTAC: AtomPub, testing your server implementation
GTAC: AtomPub, testing your server implementation
 
Slides Aquarium Paris 2008
Slides Aquarium Paris 2008Slides Aquarium Paris 2008
Slides Aquarium Paris 2008
 
10reasons
10reasons10reasons
10reasons
 
Front End Website Optimization
Front End Website OptimizationFront End Website Optimization
Front End Website Optimization
 
Introduction to SDshare
Introduction to SDshareIntroduction to SDshare
Introduction to SDshare
 
An Introduction to Solr
An Introduction to SolrAn Introduction to Solr
An Introduction to Solr
 

Mehr von Cris Holdorph

Programming for Performance
Programming for PerformanceProgramming for Performance
Programming for PerformanceCris Holdorph
 
Introduction to International MyLabs
Introduction to International MyLabsIntroduction to International MyLabs
Introduction to International MyLabsCris Holdorph
 
Using Sakai Site Archive for Good not Evil
Using Sakai Site Archive for Good not EvilUsing Sakai Site Archive for Good not Evil
Using Sakai Site Archive for Good not EvilCris Holdorph
 
Developing JSR 286 Portlets
Developing JSR 286 PortletsDeveloping JSR 286 Portlets
Developing JSR 286 PortletsCris Holdorph
 
Adding Performance Testing to a Software Development Project
Adding Performance Testing to a Software Development ProjectAdding Performance Testing to a Software Development Project
Adding Performance Testing to a Software Development ProjectCris Holdorph
 
Sakai and IMS LIS Integration
Sakai and IMS LIS IntegrationSakai and IMS LIS Integration
Sakai and IMS LIS IntegrationCris Holdorph
 
Clustering Sakai with Terracotta
Clustering Sakai with TerracottaClustering Sakai with Terracotta
Clustering Sakai with TerracottaCris Holdorph
 
Introduction to Terracotta
Introduction to TerracottaIntroduction to Terracotta
Introduction to TerracottaCris Holdorph
 

Mehr von Cris Holdorph (9)

Programming for Performance
Programming for PerformanceProgramming for Performance
Programming for Performance
 
Introduction to International MyLabs
Introduction to International MyLabsIntroduction to International MyLabs
Introduction to International MyLabs
 
Using Sakai Site Archive for Good not Evil
Using Sakai Site Archive for Good not EvilUsing Sakai Site Archive for Good not Evil
Using Sakai Site Archive for Good not Evil
 
No SQL Technologies
No SQL TechnologiesNo SQL Technologies
No SQL Technologies
 
Developing JSR 286 Portlets
Developing JSR 286 PortletsDeveloping JSR 286 Portlets
Developing JSR 286 Portlets
 
Adding Performance Testing to a Software Development Project
Adding Performance Testing to a Software Development ProjectAdding Performance Testing to a Software Development Project
Adding Performance Testing to a Software Development Project
 
Sakai and IMS LIS Integration
Sakai and IMS LIS IntegrationSakai and IMS LIS Integration
Sakai and IMS LIS Integration
 
Clustering Sakai with Terracotta
Clustering Sakai with TerracottaClustering Sakai with Terracotta
Clustering Sakai with Terracotta
 
Introduction to Terracotta
Introduction to TerracottaIntroduction to Terracotta
Introduction to Terracotta
 

Kürzlich hochgeladen

Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
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
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
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
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
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
 
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
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
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
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 

Kürzlich hochgeladen (20)

Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
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
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
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
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
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
 
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
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
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
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 

Cluster Ehcache Hibernate Terracotta Improve App Performance

  • 1. Clustering Made Easier Using Terracotta with Hibernate and/or Ehcache Cris J. Holdorph Software Architect Unicon, Inc. Jasig Conference San Diego, CA March 9, 2010 © Copyright Unicon, Inc., 2008. Some rights reserved. This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/us/
  • 2.
  • 4.
  • 7.
  • 8.
  • 10. Using Ehcache with Terracotta
  • 12. Using Hibernate with 2cd level cache
  • 16.
  • 20.
  • 21. Used by both uPortal and Sakai
  • 22.
  • 23.
  • 24. Used by both uPortal and Sakai
  • 25.
  • 27.
  • 28. Open Source and Commercial
  • 30. Many Terracotta employees are avid Twitter users
  • 31.
  • 33.
  • 34. Strong integration with Ehcache, Hibernate
  • 35. Some integration with Terracotta
  • 36. Used by both uPortal and Sakai
  • 38.
  • 39.
  • 42. pom.xml <dependency> <groupId>net.sf.ehcache</groupId> <artifactId>ehcache-core</artifactId> <version>1.7.2</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-jdk14</artifactId> <version>1.5.8</version> </dependency>
  • 43. ehcache.xml <ehcache> <diskStore path=&quot;java.io.tmpdir&quot; /> <defaultCache maxElementsInMemory=&quot;10&quot; eternal=&quot;false&quot; timeToIdleSeconds=&quot;120&quot; timeToLiveSeconds=&quot;300&quot; overflowToDisk=&quot;true&quot; /> <cache name=&quot;PEOPLE_CACHE&quot; maxElementsInMemory=&quot;2000&quot; eternal=&quot;false&quot; overflowToDisk=&quot;true&quot; timeToIdleSeconds=&quot;0&quot; timeToLiveSeconds=&quot;3600&quot; /> </ehcache>
  • 44. CensusCollectServlet.java import net.sf.ehcache.Cache; import net.sf.ehcache.CacheManager; import net.sf.ehcache.Element; … private Cache peopleCache = null; … public void init(ServletConfig config) throws ServletException { super.init(config); CacheManager manager = new CacheManager(); peopleCache = manager.getCache(&quot;PEOPLE_CACHE&quot;); } ...
  • 45. CensusCollectServlet.java ... Person person = null; Element element = peopleCache.get(ssn); if (person == null) { person = new Person(); } else { person = (Person)element.getValue(); } request.setAttribute(PERSON, person); ... peopleCache.put(new Element(ssn, person)); ...
  • 46. Using Ehcache with RMI Replication
  • 47. ehcache.xml <cacheManagerPeerProviderFactory class=&quot;net.sf.ehcache.distribution. RMICacheManagerPeerProviderFactory&quot; properties=&quot;hostName=fully_qualified_hostname_or_ip, peerDiscovery=automatic, multicastGroupAddress=230.0.0.1, multicastGroupPort=4446, timeToLive=32&quot;/> <cache name=&quot; PEOPLE_CACHE &quot; ...> <cacheEventListenerFactory class=&quot;net.sf.ehcache.distribution.RMICacheReplicatorFactory” properties=&quot;replicateAsynchronously=true, replicatePuts=true, replicatePutsViaCopy=false, replicateUpdates=true, replicateUpdatesViaCopy=true, replicateRemovals=true asynchronousReplicationIntervalMillis=1000&quot;/> </cache>
  • 48. Using Ehcache with Terracotta
  • 49. pom.xml <dependency> <groupId>net.sf.ehcache</groupId> <artifactId>ehcache-core</artifactId> <version>1.7.2</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-jdk14</artifactId> <version>1.5.8</version> </dependency> <dependency> <groupId>net.sf.ehcache</groupId> <artifactId>ehcache-terracotta</artifactId> <version>1.8.0</version> </dependency>
  • 50. ehcache.xml <ehcache> <diskStore path=&quot;java.io.tmpdir&quot; /> <defaultCache maxElementsInMemory=&quot;10&quot; eternal=&quot;false&quot; timeToIdleSeconds=&quot;120&quot; timeToLiveSeconds=&quot;300&quot; overflowToDisk=&quot;true&quot; /> <terracottaConfig url=&quot;localhost:9510&quot;/> <cache name=&quot;PEOPLE_CACHE&quot; maxElementsInMemory=&quot;2000&quot; eternal=&quot;false&quot; overflowToDisk=&quot;true&quot; timeToIdleSeconds=&quot;0&quot; timeToLiveSeconds=&quot;3600&quot; <terracotta /> </cache> </ehcache>
  • 51. Terracotta Server $ terracotta-3.2.0/bin/start-tc-server.sh Start the Terracotta Server First The Terracotta server must be started before any applications that use Terracotta.
  • 53. hibernate.cfg.xml <!DOCTYPE hibernate-configuration PUBLIC &quot;-//Hibernate/Hibernate Configuration DTD 3.0//EN&quot; &quot;http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd&quot;> <hibernate-configuration> <session-factory> <property name=&quot;connection.driver_class&quot;>org.hsqldb.jdbcDriver</property> <property name=&quot;connection.url&quot;>jdbc:hsqldb:hsql://localhost:8887</property> <property name=&quot;connection.username&quot;>sa</property> <property name=&quot;connection.password&quot;></property> <property name=&quot;connection.pool_size&quot;>2</property> <property name=&quot;dialect&quot;>org.hibernate.dialect.HSQLDialect</property> . . .
  • 54. hibernate.cfg.xml (2) . . . <property name=&quot;current_session_context_class&quot;>org.hibernate.context.ManagedSessionContext</property> <property name=&quot;cache.provider_class&quot;> org.hibernate.cache.NoCacheProvider </property> <property name=&quot;show_sql&quot;>true</property> <property name=&quot;hbm2ddl.auto&quot;>validate</property> <mapping resource=&quot;org/jasig/census/Person.hbm.xml&quot;/> </session-factory> </hibernate-configuration>
  • 55. Person.hbm.xml <?xml version=&quot;1.0&quot;?> <!DOCTYPE hibernate-mapping PUBLIC &quot;-//Hibernate/Hibernate Mapping DTD 3.0//EN&quot; &quot;http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd&quot;> <hibernate-mapping package=&quot;org.jasig.census&quot;> <class name=&quot;Person&quot; table=&quot;PERSON&quot;> <cache usage=&quot;read-write&quot; /> <id name=&quot;id&quot; column=&quot;PERSON_ID&quot;> <generator class=&quot;native&quot;/> </id> <property name=&quot;name&quot;/> <property name=&quot;city&quot;/> <property name=&quot;state&quot;/> <property name=&quot;ssn&quot;/> </class> </hibernate-mapping>
  • 56. pom.xml <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-core</artifactId> <version>3.3.2.GA</version> </dependency> <dependency> <groupId>javassist</groupId> <artifactId>javassist</artifactId> <version>3.8.0.GA</version> </dependency> <dependency> <groupId>hsqldb</groupId> <artifactId>hsqldb</artifactId> <version>1.8.0.7</version> </dependency>
  • 57. getAllPeople() (.java code) public static List<?> getAllPeople() { SessionFactory sf = getSessionFactory(); Session session = sf.openSession(); session.beginTransaction(); List<?> result = session.createQuery(&quot;from Person&quot;).list(); session.getTransaction().commit(); session.close(); return result; }
  • 58. Using Hibernate with a Second Level Cache Ehcache
  • 59. pom.xml <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-core</artifactId> <version>3.3.2.GA</version> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-ehcache</artifactId> <version>3.3.2.GA</version> </dependency> <dependency> <groupId>javassist</groupId> <artifactId>javassist</artifactId> <version>3.8.0.GA</version> </dependency> . . .
  • 60. hibernate.cfg.xml . . . <property name=&quot;current_session_context_class&quot;>org.hibernate.context.ManagedSessionContext</property> <property name=&quot;use_second_level_cache&quot;>true</property> <property name=&quot;cache.provider_class&quot;>org.hibernate.cache.EhCacheProvider</property> <property name=&quot;show_sql&quot;>true</property> <property name=&quot;hbm2ddl.auto&quot;>validate</property> <mapping resource=&quot;org/jasig/census/Person.hbm.xml&quot;/> </session-factory> </hibernate-configuration>
  • 61. ehcache.xml <ehcache> <diskStore path=&quot;java.io.tmpdir&quot; /> <defaultCache maxElementsInMemory=&quot;10&quot; overflowToDisk=&quot;true&quot; timeToIdleSeconds=&quot;120&quot; timeToLiveSeconds=&quot;300&quot; eternal=&quot;false&quot; /> <cache name=&quot;org.jasig.census.Person&quot; maxElementsInMemory=&quot;10000&quot; eternal=&quot;false&quot; timeToIdleSeconds=&quot;3000&quot; timeToLiveSeconds=&quot;6000&quot; overflowToDisk=&quot;false&quot; /> <cache name=&quot;query.findAllPeople&quot; maxElementsInMemory=&quot;50&quot; eternal=&quot;false&quot; timeToLiveSeconds=&quot;86400&quot; overflowToDisk=&quot;false&quot; /> </ehcache>
  • 62. getAllPeople() (.java code) public static List<?> getAllPeople() { SessionFactory sf = getSessionFactory(); Session session = sf.openSession(); session.beginTransaction(); List<?> result = session.createQuery(&quot;from Person&quot;). setCacheable(true).setCacheRegion(&quot;query.findAllPeople&quot;). list(); session.getTransaction().commit(); session.close(); return result; }
  • 63. Using Hibernate with a Second Level Cache Terracotta
  • 64. pom.xml <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-core</artifactId> <version>3.3.2.GA</version> </dependency> <dependency> <groupId>org.terracotta.hibernate</groupId> <artifactId>terracotta-hibernate-cache</artifactId> <version>1.1.0</version> </dependency> <dependency> <groupId>javassist</groupId> <artifactId>javassist</artifactId> <version>3.8.0.GA</version> </dependency> . . .
  • 65. pom.xml (2) . . . <repositories> <repository> <id>terracotta-repository</id> <url>http://www.terracotta.org/download/reflector/maven2</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </repository> </repositories> </project>
  • 66. hibernate.cfg.xml . . . <property name=&quot;current_session_context_class&quot;>org.hibernate.context.ManagedSessionContext</property> <property name=&quot;use_second_level_cache&quot;>true</property> <property name=&quot;cache.provider_class&quot;> org.terracotta.hibernate.TerracottaHibernateCacheProvider </property> <property name=&quot;show_sql&quot;>true</property> <property name=&quot;hbm2ddl.auto&quot;>validate</property> <mapping resource=&quot;org/jasig/census/Person.hbm.xml&quot;/> </session-factory> </hibernate-configuration>
  • 67. Terracotta Server $ /opt/terracotta-3.2.0/bin/start-tc-server.sh Start the Terracotta Server First The Terracotta server must be started before any applications that use Terracotta.
  • 68. Hibernate Application $ export JAVA_OPTS=&quot;-javaagent:/opt/terracotta-3.2.0/hibernate/terracotta-hibernate-agent-1.1.0.jar&quot; $ /opt/apache-tomcat-6.0.24/bin/startup.sh Start Application with Options The application must be started with special JAVA_OPTS set for Terracotta.
  • 70.
  • 71. Multiple Terracotta Servers in clustered mode
  • 72.
  • 73. Express mode vs Custom/Identity Mode
  • 74. Administration Console $ /opt/terracotta-3.2.0/bin/ dev-console.sh
  • 76.
  • 78.
  • 80.
  • 81. Service for system administrators to learn / support
  • 82.
  • 83. Twitter / Blogs are great
  • 84.
  • 85.
  • 86. Terracotta 3.2.0 requires Ehcache-terracotta 1.8.0
  • 87. Terracotta 3.2.1 (not yet released) will require Ehcache-terracotta 2.0.0
  • 88. Ehcache-Terracotta Express mode fully serializes objects
  • 89. Ehcache-Custom mode (also called Identity mode) requires custom tc-config.xml file
  • 90.
  • 91.
  • 92.
  • 93.
  • 96. Questions & Answers Cris J. Holdorph Software Architect Unicon, Inc. [email_address] www.unicon.net