SlideShare a Scribd company logo
1 of 29
Download to read offline
Ehcache 3
JSR-107 on Steroids
alex snaps — principal software engineer at terracotta
@alexsnaps
A little about me
• Introducing new bugs to the world for 30+ years
• Coding in Java for 16+ years
• Works at Terracotta for 6+ years
• DSO, Ehcache, Quartz, …
• OSS Contributor
• Into API design, concurrency, distributed systems…
A little of history
[014] - Easy Hibernate Cache 0.5
  by Greg Luck (http://freshmeat.net/users/gregrluck/)
  Saturday, November 29th 2003 12:54
Software Development :: Libraries :: Java Libraries
About: Easy Hibernate Cache is a fast and simple, pure Java, in-process
cache, which acts as a pluggable cache for Hibernate 2.1. It has a small
memory footprint, minimal dependencies, and full documentation.
License: The Apache License
A little of history
• Terracotta founded in 2003, in San Francisco
• Open sourced DSO in 2006
• Acquires Ehcache in Aug. 2009
• Releases Ehcache 2.0 Mar. 2010
• Software AG acquires Terracotta in 2011
• JSR-107 Final Mar. 2014 (13 years after the JSR review ballot!)
• Work on Ehcache 3.0 begins…
javax.cache
Picture by Leo Reynolds
JSR 107
• Java Community Process driven standard
• Specifies API and semantics for temporary, 

in-memory caching of Java objects, including object creation,
shared access, spooling, invalidation, and consistency across
JVM's
Caching
• Data structure holding temporary copy of data
• Trades memory usage for reduced latency
• Targets:
• Data which is reused
• Data which is expensive to retrieve / compute
• Keeps the data close(r) to the processing unit
javax.cache API
• CacheManagers managing … Caches !
• Expiry
• Integration
• Cache Entry Listeners
• Entry Processors
• Caching Annotations
• Some Management
CacheManager
• Caching.getCachingProvider() static method
• CachingProvider.getCacheManager()
• CachingProvider
• CacheManager repository
• Identified by name & ClassLoader
CacheManager
• CacheManager
• Manages Cache lifecycle:
• Create & Destroy
• Repository of (named) Cache instances
• Manages Cache JMX (stats & management)
• … is .unwrap()’ able
Demo
… showing off a couple of caveats!
Ehcache
steroids for javax.cache
Tiered Storage
• Very similar to Ehcache 2.x
• Lowest & slowest tier is the “authority”
• Higher & faster tiers effectively act as caches
• Available today:
• Heap,
• Off-Heap,
• Disk
Store by value vs. by ref
• JSR 107 “store modes”
• “by value” (default),
• “by reference” (optional)
• What about “I don’t care” ?
• Introducing Ehcache org.ehcache.spi.copy.Copier
Custom Serialization
• Defaults to Java Serialization for
• JSR 107’s store-by-value
• Storing data elsewhere than the heap
• Introducing org.ehcache.spi.serialization.Serializer
Proper Typing
• Why is that important?
• No one wants to catch ClassCastException
• Application lifecycle!
• Ehcache records the key & value types in all its stores!
• But… there is a MutableConfiguration bug
CacheLoader & -Writer
• Ehcache’s CacheLoader/Writer API
• Enables the Cache through pattern
• Consistently across all Cache operations
• Single CacheLoaderWriter interface
• Throughput favoring Cache, not SoR
WriteBehind
• Scale out writes to your SoR
• Batching and/or coalescing them
• Even simpler than with Ehcache 2
• No more sizing gotcha!
WriterCache
Application
code
RDBMS
Writer
Expiry Policy
• JSR 107’s ExpiryPolicy
• No contextual information about the Expiry calculated
• Works for simple expiry (Accessed, Created, Modified, …)
• Introducing the org.ehcache.expiry.Expiry
Eviction Prioritizer & Veto
• Eviction not addressed by 107 at all
• org.ehcache.config.EvictionPrioritizer
• org.ehcache.config.EvictionVeto
• Both are hints though!
Transactions
• Full blown XA Resource
• including recovery support
• Developed as a independent Ehcache module
• Currently (still?) included in the main “distribution”
Future
… or a couple of days ago
Automatic Resource Control
• Size your on heap caches in natural units
• n bytes
• Percentage of the (maximal) available VM heap
• Define “resource pools” shared across caches
Clustering
• Terracotta Server Array version 5.0 (work in progress)
• Single stripe available as FOSS
• Uses our offheap-store library
• Passive fail-over
• Ehcache’s consistency mode:
• Strong
• Eventual
• Proper life cycle (finally!)
Resilience Strategy
• A cache is to be resilient
• Yet… sh*t happens
• Storage failures
• SLA violations (timeouts?)
• Very explicit contract at this time
• To be refined when clustering is wrapping up
… and moar!
• Looking at Hibernate 2nd Level Cache (through 107!)
• Advanced features to Spring (& Spring Boot)
• … your ideas!?
Where from here?
ehcache.org
Questions?
www.ehcache.org

More Related Content

What's hot

Caching technology comparison
Caching technology comparisonCaching technology comparison
Caching technology comparisonRohit Kelapure
 
Postgres on OpenStack
Postgres on OpenStackPostgres on OpenStack
Postgres on OpenStackEDB
 
Distributed Caching Using the JCACHE API and ehcache, Including a Case Study ...
Distributed Caching Using the JCACHE API and ehcache, Including a Case Study ...Distributed Caching Using the JCACHE API and ehcache, Including a Case Study ...
Distributed Caching Using the JCACHE API and ehcache, Including a Case Study ...elliando dias
 
Scale ColdFusion with Terracotta Distributed Caching for Ehchache
Scale ColdFusion with Terracotta Distributed Caching for EhchacheScale ColdFusion with Terracotta Distributed Caching for Ehchache
Scale ColdFusion with Terracotta Distributed Caching for EhchacheColdFusionConference
 
Aem dispatcher – tips & tricks
Aem dispatcher – tips & tricksAem dispatcher – tips & tricks
Aem dispatcher – tips & tricksAshokkumar T A
 
The secret life of a dispatcher (Adobe CQ AEM)
The secret life of a dispatcher (Adobe CQ AEM)The secret life of a dispatcher (Adobe CQ AEM)
The secret life of a dispatcher (Adobe CQ AEM)Venugopal Gummadala
 
Caching with Memcached and APC
Caching with Memcached and APCCaching with Memcached and APC
Caching with Memcached and APCBen Ramsey
 
Improving Website Performance with Memecached Webinar | Achieve Internet
Improving Website Performance with Memecached Webinar | Achieve InternetImproving Website Performance with Memecached Webinar | Achieve Internet
Improving Website Performance with Memecached Webinar | Achieve InternetAchieve Internet
 
Best Practices with PostgreSQL on Solaris
Best Practices with PostgreSQL on SolarisBest Practices with PostgreSQL on Solaris
Best Practices with PostgreSQL on SolarisJignesh Shah
 
The new repository in AEM 6
The new repository in AEM 6The new repository in AEM 6
The new repository in AEM 6Jukka Zitting
 
Deep Dive into RDS PostgreSQL Universe
Deep Dive into RDS PostgreSQL UniverseDeep Dive into RDS PostgreSQL Universe
Deep Dive into RDS PostgreSQL UniverseJignesh Shah
 
VMworld 2013: vSphere Flash Read Cache Technical Overview
VMworld 2013: vSphere Flash Read Cache Technical Overview VMworld 2013: vSphere Flash Read Cache Technical Overview
VMworld 2013: vSphere Flash Read Cache Technical Overview VMworld
 
Postgres Plus Cloud Database on OpenStack
Postgres Plus Cloud Database on OpenStackPostgres Plus Cloud Database on OpenStack
Postgres Plus Cloud Database on OpenStackKamesh Pemmaraju
 
Web session replication with Hazelcast
Web session replication with HazelcastWeb session replication with Hazelcast
Web session replication with HazelcastEmrah Kocaman
 
Cloud computing 3702
Cloud computing 3702Cloud computing 3702
Cloud computing 3702Jess Coburn
 
Implementing High Availability Caching with Memcached
Implementing High Availability Caching with MemcachedImplementing High Availability Caching with Memcached
Implementing High Availability Caching with MemcachedGear6
 

What's hot (19)

Caching technology comparison
Caching technology comparisonCaching technology comparison
Caching technology comparison
 
Postgres on OpenStack
Postgres on OpenStackPostgres on OpenStack
Postgres on OpenStack
 
Distributed Caching Using the JCACHE API and ehcache, Including a Case Study ...
Distributed Caching Using the JCACHE API and ehcache, Including a Case Study ...Distributed Caching Using the JCACHE API and ehcache, Including a Case Study ...
Distributed Caching Using the JCACHE API and ehcache, Including a Case Study ...
 
PostgreSQL Query Cache - "pqc"
PostgreSQL Query Cache - "pqc"PostgreSQL Query Cache - "pqc"
PostgreSQL Query Cache - "pqc"
 
Scale ColdFusion with Terracotta Distributed Caching for Ehchache
Scale ColdFusion with Terracotta Distributed Caching for EhchacheScale ColdFusion with Terracotta Distributed Caching for Ehchache
Scale ColdFusion with Terracotta Distributed Caching for Ehchache
 
Aem dispatcher – tips & tricks
Aem dispatcher – tips & tricksAem dispatcher – tips & tricks
Aem dispatcher – tips & tricks
 
The secret life of a dispatcher (Adobe CQ AEM)
The secret life of a dispatcher (Adobe CQ AEM)The secret life of a dispatcher (Adobe CQ AEM)
The secret life of a dispatcher (Adobe CQ AEM)
 
Caching
CachingCaching
Caching
 
Caching with Memcached and APC
Caching with Memcached and APCCaching with Memcached and APC
Caching with Memcached and APC
 
Improving Website Performance with Memecached Webinar | Achieve Internet
Improving Website Performance with Memecached Webinar | Achieve InternetImproving Website Performance with Memecached Webinar | Achieve Internet
Improving Website Performance with Memecached Webinar | Achieve Internet
 
Best Practices with PostgreSQL on Solaris
Best Practices with PostgreSQL on SolarisBest Practices with PostgreSQL on Solaris
Best Practices with PostgreSQL on Solaris
 
The new repository in AEM 6
The new repository in AEM 6The new repository in AEM 6
The new repository in AEM 6
 
Deep Dive into RDS PostgreSQL Universe
Deep Dive into RDS PostgreSQL UniverseDeep Dive into RDS PostgreSQL Universe
Deep Dive into RDS PostgreSQL Universe
 
VMworld 2013: vSphere Flash Read Cache Technical Overview
VMworld 2013: vSphere Flash Read Cache Technical Overview VMworld 2013: vSphere Flash Read Cache Technical Overview
VMworld 2013: vSphere Flash Read Cache Technical Overview
 
Alfresco tuning part1
Alfresco tuning part1Alfresco tuning part1
Alfresco tuning part1
 
Postgres Plus Cloud Database on OpenStack
Postgres Plus Cloud Database on OpenStackPostgres Plus Cloud Database on OpenStack
Postgres Plus Cloud Database on OpenStack
 
Web session replication with Hazelcast
Web session replication with HazelcastWeb session replication with Hazelcast
Web session replication with Hazelcast
 
Cloud computing 3702
Cloud computing 3702Cloud computing 3702
Cloud computing 3702
 
Implementing High Availability Caching with Memcached
Implementing High Availability Caching with MemcachedImplementing High Availability Caching with Memcached
Implementing High Availability Caching with Memcached
 

Similar to Ehcache3 — JSR-107 on steroids

Using JCache to speed up your apps
Using JCache to speed up your appsUsing JCache to speed up your apps
Using JCache to speed up your appsVassilis Bekiaris
 
Caching reboot: javax.cache & Ehcache 3
Caching reboot: javax.cache & Ehcache 3Caching reboot: javax.cache & Ehcache 3
Caching reboot: javax.cache & Ehcache 3Louis Jacomet
 
Caching in applications still matters
Caching in applications still mattersCaching in applications still matters
Caching in applications still mattersAnthony Dahanne
 
Ehcache 3: JSR-107 on steroids at Devoxx Morocco
Ehcache 3: JSR-107 on steroids at Devoxx MoroccoEhcache 3: JSR-107 on steroids at Devoxx Morocco
Ehcache 3: JSR-107 on steroids at Devoxx MoroccoLouis Jacomet
 
Caching and JCache with Greg Luck 18.02.16
Caching and JCache with Greg Luck 18.02.16Caching and JCache with Greg Luck 18.02.16
Caching and JCache with Greg Luck 18.02.16Comsysto Reply GmbH
 
How does Apache Pegasus (incubating) community develop at SensorsData
How does Apache Pegasus (incubating) community develop at SensorsDataHow does Apache Pegasus (incubating) community develop at SensorsData
How does Apache Pegasus (incubating) community develop at SensorsDataacelyc1112009
 
Where Django Caching Bust at the Seams
Where Django Caching Bust at the SeamsWhere Django Caching Bust at the Seams
Where Django Caching Bust at the SeamsConcentric Sky
 
ContainerCon EU 2016 - Software-Defined Storage and Container Schedulers
ContainerCon EU 2016 - Software-Defined Storage and Container SchedulersContainerCon EU 2016 - Software-Defined Storage and Container Schedulers
ContainerCon EU 2016 - Software-Defined Storage and Container SchedulersDavid vonThenen
 
Distributed applications using Hazelcast
Distributed applications using HazelcastDistributed applications using Hazelcast
Distributed applications using HazelcastTaras Matyashovsky
 
JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]
JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]
JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]Speedment, Inc.
 
JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]
JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]
JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]Malin Weiss
 
Caching your rails application
Caching your rails applicationCaching your rails application
Caching your rails applicationArrrrCamp
 
Real-Time Distributed and Reactive Systems with Apache Kafka and Apache Accumulo
Real-Time Distributed and Reactive Systems with Apache Kafka and Apache AccumuloReal-Time Distributed and Reactive Systems with Apache Kafka and Apache Accumulo
Real-Time Distributed and Reactive Systems with Apache Kafka and Apache AccumuloJoe Stein
 
Accumulo Summit 2015: Real-Time Distributed and Reactive Systems with Apache ...
Accumulo Summit 2015: Real-Time Distributed and Reactive Systems with Apache ...Accumulo Summit 2015: Real-Time Distributed and Reactive Systems with Apache ...
Accumulo Summit 2015: Real-Time Distributed and Reactive Systems with Apache ...Accumulo Summit
 
IMC Summit 2016 Breakout - Greg Luck - How to Speed Up Your Application Using...
IMC Summit 2016 Breakout - Greg Luck - How to Speed Up Your Application Using...IMC Summit 2016 Breakout - Greg Luck - How to Speed Up Your Application Using...
IMC Summit 2016 Breakout - Greg Luck - How to Speed Up Your Application Using...In-Memory Computing Summit
 
06 integrate elasticsearch
06 integrate elasticsearch06 integrate elasticsearch
06 integrate elasticsearchErhwen Kuo
 

Similar to Ehcache3 — JSR-107 on steroids (20)

Ehcache 3 @ BruJUG
Ehcache 3 @ BruJUGEhcache 3 @ BruJUG
Ehcache 3 @ BruJUG
 
Using JCache to speed up your apps
Using JCache to speed up your appsUsing JCache to speed up your apps
Using JCache to speed up your apps
 
Caching reboot: javax.cache & Ehcache 3
Caching reboot: javax.cache & Ehcache 3Caching reboot: javax.cache & Ehcache 3
Caching reboot: javax.cache & Ehcache 3
 
Hazelcast 101
Hazelcast 101Hazelcast 101
Hazelcast 101
 
Caching in applications still matters
Caching in applications still mattersCaching in applications still matters
Caching in applications still matters
 
Ehcache 3: JSR-107 on steroids at Devoxx Morocco
Ehcache 3: JSR-107 on steroids at Devoxx MoroccoEhcache 3: JSR-107 on steroids at Devoxx Morocco
Ehcache 3: JSR-107 on steroids at Devoxx Morocco
 
Caching and JCache with Greg Luck 18.02.16
Caching and JCache with Greg Luck 18.02.16Caching and JCache with Greg Luck 18.02.16
Caching and JCache with Greg Luck 18.02.16
 
How does Apache Pegasus (incubating) community develop at SensorsData
How does Apache Pegasus (incubating) community develop at SensorsDataHow does Apache Pegasus (incubating) community develop at SensorsData
How does Apache Pegasus (incubating) community develop at SensorsData
 
JCache Using JCache
JCache Using JCacheJCache Using JCache
JCache Using JCache
 
Where Django Caching Bust at the Seams
Where Django Caching Bust at the SeamsWhere Django Caching Bust at the Seams
Where Django Caching Bust at the Seams
 
Mini-Training: To cache or not to cache
Mini-Training: To cache or not to cacheMini-Training: To cache or not to cache
Mini-Training: To cache or not to cache
 
ContainerCon EU 2016 - Software-Defined Storage and Container Schedulers
ContainerCon EU 2016 - Software-Defined Storage and Container SchedulersContainerCon EU 2016 - Software-Defined Storage and Container Schedulers
ContainerCon EU 2016 - Software-Defined Storage and Container Schedulers
 
Distributed applications using Hazelcast
Distributed applications using HazelcastDistributed applications using Hazelcast
Distributed applications using Hazelcast
 
JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]
JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]
JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]
 
JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]
JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]
JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]
 
Caching your rails application
Caching your rails applicationCaching your rails application
Caching your rails application
 
Real-Time Distributed and Reactive Systems with Apache Kafka and Apache Accumulo
Real-Time Distributed and Reactive Systems with Apache Kafka and Apache AccumuloReal-Time Distributed and Reactive Systems with Apache Kafka and Apache Accumulo
Real-Time Distributed and Reactive Systems with Apache Kafka and Apache Accumulo
 
Accumulo Summit 2015: Real-Time Distributed and Reactive Systems with Apache ...
Accumulo Summit 2015: Real-Time Distributed and Reactive Systems with Apache ...Accumulo Summit 2015: Real-Time Distributed and Reactive Systems with Apache ...
Accumulo Summit 2015: Real-Time Distributed and Reactive Systems with Apache ...
 
IMC Summit 2016 Breakout - Greg Luck - How to Speed Up Your Application Using...
IMC Summit 2016 Breakout - Greg Luck - How to Speed Up Your Application Using...IMC Summit 2016 Breakout - Greg Luck - How to Speed Up Your Application Using...
IMC Summit 2016 Breakout - Greg Luck - How to Speed Up Your Application Using...
 
06 integrate elasticsearch
06 integrate elasticsearch06 integrate elasticsearch
06 integrate elasticsearch
 

Recently uploaded

Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLDeelipZope
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxk795866
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and usesDevarapalliHaritha
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)dollysharma2066
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learningmisbanausheenparvam
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...asadnawaz62
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 

Recently uploaded (20)

Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCL
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptx
 
POWER SYSTEMS-1 Complete notes examples
POWER SYSTEMS-1 Complete notes  examplesPOWER SYSTEMS-1 Complete notes  examples
POWER SYSTEMS-1 Complete notes examples
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and uses
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learning
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 

Ehcache3 — JSR-107 on steroids

  • 1. Ehcache 3 JSR-107 on Steroids alex snaps — principal software engineer at terracotta @alexsnaps
  • 2. A little about me • Introducing new bugs to the world for 30+ years • Coding in Java for 16+ years • Works at Terracotta for 6+ years • DSO, Ehcache, Quartz, … • OSS Contributor • Into API design, concurrency, distributed systems…
  • 3. A little of history [014] - Easy Hibernate Cache 0.5   by Greg Luck (http://freshmeat.net/users/gregrluck/)   Saturday, November 29th 2003 12:54 Software Development :: Libraries :: Java Libraries About: Easy Hibernate Cache is a fast and simple, pure Java, in-process cache, which acts as a pluggable cache for Hibernate 2.1. It has a small memory footprint, minimal dependencies, and full documentation. License: The Apache License
  • 4. A little of history • Terracotta founded in 2003, in San Francisco • Open sourced DSO in 2006 • Acquires Ehcache in Aug. 2009 • Releases Ehcache 2.0 Mar. 2010 • Software AG acquires Terracotta in 2011 • JSR-107 Final Mar. 2014 (13 years after the JSR review ballot!) • Work on Ehcache 3.0 begins…
  • 6. JSR 107 • Java Community Process driven standard • Specifies API and semantics for temporary, 
 in-memory caching of Java objects, including object creation, shared access, spooling, invalidation, and consistency across JVM's
  • 7. Caching • Data structure holding temporary copy of data • Trades memory usage for reduced latency • Targets: • Data which is reused • Data which is expensive to retrieve / compute • Keeps the data close(r) to the processing unit
  • 8. javax.cache API • CacheManagers managing … Caches ! • Expiry • Integration • Cache Entry Listeners • Entry Processors • Caching Annotations • Some Management
  • 9. CacheManager • Caching.getCachingProvider() static method • CachingProvider.getCacheManager() • CachingProvider • CacheManager repository • Identified by name & ClassLoader
  • 10. CacheManager • CacheManager • Manages Cache lifecycle: • Create & Destroy • Repository of (named) Cache instances • Manages Cache JMX (stats & management) • … is .unwrap()’ able
  • 11. Demo … showing off a couple of caveats!
  • 13. Tiered Storage • Very similar to Ehcache 2.x • Lowest & slowest tier is the “authority” • Higher & faster tiers effectively act as caches • Available today: • Heap, • Off-Heap, • Disk
  • 14. Store by value vs. by ref • JSR 107 “store modes” • “by value” (default), • “by reference” (optional) • What about “I don’t care” ? • Introducing Ehcache org.ehcache.spi.copy.Copier
  • 15. Custom Serialization • Defaults to Java Serialization for • JSR 107’s store-by-value • Storing data elsewhere than the heap • Introducing org.ehcache.spi.serialization.Serializer
  • 16. Proper Typing • Why is that important? • No one wants to catch ClassCastException • Application lifecycle! • Ehcache records the key & value types in all its stores! • But… there is a MutableConfiguration bug
  • 17. CacheLoader & -Writer • Ehcache’s CacheLoader/Writer API • Enables the Cache through pattern • Consistently across all Cache operations • Single CacheLoaderWriter interface • Throughput favoring Cache, not SoR
  • 18. WriteBehind • Scale out writes to your SoR • Batching and/or coalescing them • Even simpler than with Ehcache 2 • No more sizing gotcha!
  • 20. Expiry Policy • JSR 107’s ExpiryPolicy • No contextual information about the Expiry calculated • Works for simple expiry (Accessed, Created, Modified, …) • Introducing the org.ehcache.expiry.Expiry
  • 21. Eviction Prioritizer & Veto • Eviction not addressed by 107 at all • org.ehcache.config.EvictionPrioritizer • org.ehcache.config.EvictionVeto • Both are hints though!
  • 22. Transactions • Full blown XA Resource • including recovery support • Developed as a independent Ehcache module • Currently (still?) included in the main “distribution”
  • 23. Future … or a couple of days ago
  • 24. Automatic Resource Control • Size your on heap caches in natural units • n bytes • Percentage of the (maximal) available VM heap • Define “resource pools” shared across caches
  • 25. Clustering • Terracotta Server Array version 5.0 (work in progress) • Single stripe available as FOSS • Uses our offheap-store library • Passive fail-over • Ehcache’s consistency mode: • Strong • Eventual • Proper life cycle (finally!)
  • 26. Resilience Strategy • A cache is to be resilient • Yet… sh*t happens • Storage failures • SLA violations (timeouts?) • Very explicit contract at this time • To be refined when clustering is wrapping up
  • 27. … and moar! • Looking at Hibernate 2nd Level Cache (through 107!) • Advanced features to Spring (& Spring Boot) • … your ideas!?