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
 
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
 
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
 
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
 
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 ...
 
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
 
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

Research Methodology for Engineering pdf
Research Methodology for Engineering pdfResearch Methodology for Engineering pdf
Research Methodology for Engineering pdfCaalaaAbdulkerim
 
multiple access in wireless communication
multiple access in wireless communicationmultiple access in wireless communication
multiple access in wireless communicationpanditadesh123
 
Levelling - Rise and fall - Height of instrument method
Levelling - Rise and fall - Height of instrument methodLevelling - Rise and fall - Height of instrument method
Levelling - Rise and fall - Height of instrument methodManicka Mamallan Andavar
 
ROBOETHICS-CCS345 ETHICS AND ARTIFICIAL INTELLIGENCE.ppt
ROBOETHICS-CCS345 ETHICS AND ARTIFICIAL INTELLIGENCE.pptROBOETHICS-CCS345 ETHICS AND ARTIFICIAL INTELLIGENCE.ppt
ROBOETHICS-CCS345 ETHICS AND ARTIFICIAL INTELLIGENCE.pptJohnWilliam111370
 
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...Erbil Polytechnic University
 
『澳洲文凭』买麦考瑞大学毕业证书成绩单办理澳洲Macquarie文凭学位证书
『澳洲文凭』买麦考瑞大学毕业证书成绩单办理澳洲Macquarie文凭学位证书『澳洲文凭』买麦考瑞大学毕业证书成绩单办理澳洲Macquarie文凭学位证书
『澳洲文凭』买麦考瑞大学毕业证书成绩单办理澳洲Macquarie文凭学位证书rnrncn29
 
Earthing details of Electrical Substation
Earthing details of Electrical SubstationEarthing details of Electrical Substation
Earthing details of Electrical Substationstephanwindworld
 
TEST CASE GENERATION GENERATION BLOCK BOX APPROACH
TEST CASE GENERATION GENERATION BLOCK BOX APPROACHTEST CASE GENERATION GENERATION BLOCK BOX APPROACH
TEST CASE GENERATION GENERATION BLOCK BOX APPROACHSneha Padhiar
 
Ch10-Global Supply Chain - Cadena de Suministro.pdf
Ch10-Global Supply Chain - Cadena de Suministro.pdfCh10-Global Supply Chain - Cadena de Suministro.pdf
Ch10-Global Supply Chain - Cadena de Suministro.pdfChristianCDAM
 
Engineering Drawing section of solid
Engineering Drawing     section of solidEngineering Drawing     section of solid
Engineering Drawing section of solidnamansinghjarodiya
 
Artificial Intelligence in Power System overview
Artificial Intelligence in Power System overviewArtificial Intelligence in Power System overview
Artificial Intelligence in Power System overviewsandhya757531
 
Robotics Group 10 (Control Schemes) cse.pdf
Robotics Group 10  (Control Schemes) cse.pdfRobotics Group 10  (Control Schemes) cse.pdf
Robotics Group 10 (Control Schemes) cse.pdfsahilsajad201
 
Novel 3D-Printed Soft Linear and Bending Actuators
Novel 3D-Printed Soft Linear and Bending ActuatorsNovel 3D-Printed Soft Linear and Bending Actuators
Novel 3D-Printed Soft Linear and Bending ActuatorsResearcher Researcher
 
Main Memory Management in Operating System
Main Memory Management in Operating SystemMain Memory Management in Operating System
Main Memory Management in Operating SystemRashmi Bhat
 
Stork Webinar | APM Transformational planning, Tool Selection & Performance T...
Stork Webinar | APM Transformational planning, Tool Selection & Performance T...Stork Webinar | APM Transformational planning, Tool Selection & Performance T...
Stork Webinar | APM Transformational planning, Tool Selection & Performance T...Stork
 
SOFTWARE ESTIMATION COCOMO AND FP CALCULATION
SOFTWARE ESTIMATION COCOMO AND FP CALCULATIONSOFTWARE ESTIMATION COCOMO AND FP CALCULATION
SOFTWARE ESTIMATION COCOMO AND FP CALCULATIONSneha Padhiar
 
DEVICE DRIVERS AND INTERRUPTS SERVICE MECHANISM.pdf
DEVICE DRIVERS AND INTERRUPTS  SERVICE MECHANISM.pdfDEVICE DRIVERS AND INTERRUPTS  SERVICE MECHANISM.pdf
DEVICE DRIVERS AND INTERRUPTS SERVICE MECHANISM.pdfAkritiPradhan2
 
2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.
2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.
2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.elesangwon
 
Mine Environment II Lab_MI10448MI__________.pptx
Mine Environment II Lab_MI10448MI__________.pptxMine Environment II Lab_MI10448MI__________.pptx
Mine Environment II Lab_MI10448MI__________.pptxRomil Mishra
 

Recently uploaded (20)

Research Methodology for Engineering pdf
Research Methodology for Engineering pdfResearch Methodology for Engineering pdf
Research Methodology for Engineering pdf
 
multiple access in wireless communication
multiple access in wireless communicationmultiple access in wireless communication
multiple access in wireless communication
 
Levelling - Rise and fall - Height of instrument method
Levelling - Rise and fall - Height of instrument methodLevelling - Rise and fall - Height of instrument method
Levelling - Rise and fall - Height of instrument method
 
ROBOETHICS-CCS345 ETHICS AND ARTIFICIAL INTELLIGENCE.ppt
ROBOETHICS-CCS345 ETHICS AND ARTIFICIAL INTELLIGENCE.pptROBOETHICS-CCS345 ETHICS AND ARTIFICIAL INTELLIGENCE.ppt
ROBOETHICS-CCS345 ETHICS AND ARTIFICIAL INTELLIGENCE.ppt
 
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
 
『澳洲文凭』买麦考瑞大学毕业证书成绩单办理澳洲Macquarie文凭学位证书
『澳洲文凭』买麦考瑞大学毕业证书成绩单办理澳洲Macquarie文凭学位证书『澳洲文凭』买麦考瑞大学毕业证书成绩单办理澳洲Macquarie文凭学位证书
『澳洲文凭』买麦考瑞大学毕业证书成绩单办理澳洲Macquarie文凭学位证书
 
Earthing details of Electrical Substation
Earthing details of Electrical SubstationEarthing details of Electrical Substation
Earthing details of Electrical Substation
 
TEST CASE GENERATION GENERATION BLOCK BOX APPROACH
TEST CASE GENERATION GENERATION BLOCK BOX APPROACHTEST CASE GENERATION GENERATION BLOCK BOX APPROACH
TEST CASE GENERATION GENERATION BLOCK BOX APPROACH
 
Ch10-Global Supply Chain - Cadena de Suministro.pdf
Ch10-Global Supply Chain - Cadena de Suministro.pdfCh10-Global Supply Chain - Cadena de Suministro.pdf
Ch10-Global Supply Chain - Cadena de Suministro.pdf
 
Engineering Drawing section of solid
Engineering Drawing     section of solidEngineering Drawing     section of solid
Engineering Drawing section of solid
 
Artificial Intelligence in Power System overview
Artificial Intelligence in Power System overviewArtificial Intelligence in Power System overview
Artificial Intelligence in Power System overview
 
Robotics Group 10 (Control Schemes) cse.pdf
Robotics Group 10  (Control Schemes) cse.pdfRobotics Group 10  (Control Schemes) cse.pdf
Robotics Group 10 (Control Schemes) cse.pdf
 
Novel 3D-Printed Soft Linear and Bending Actuators
Novel 3D-Printed Soft Linear and Bending ActuatorsNovel 3D-Printed Soft Linear and Bending Actuators
Novel 3D-Printed Soft Linear and Bending Actuators
 
Main Memory Management in Operating System
Main Memory Management in Operating SystemMain Memory Management in Operating System
Main Memory Management in Operating System
 
Stork Webinar | APM Transformational planning, Tool Selection & Performance T...
Stork Webinar | APM Transformational planning, Tool Selection & Performance T...Stork Webinar | APM Transformational planning, Tool Selection & Performance T...
Stork Webinar | APM Transformational planning, Tool Selection & Performance T...
 
SOFTWARE ESTIMATION COCOMO AND FP CALCULATION
SOFTWARE ESTIMATION COCOMO AND FP CALCULATIONSOFTWARE ESTIMATION COCOMO AND FP CALCULATION
SOFTWARE ESTIMATION COCOMO AND FP CALCULATION
 
Designing pile caps according to ACI 318-19.pptx
Designing pile caps according to ACI 318-19.pptxDesigning pile caps according to ACI 318-19.pptx
Designing pile caps according to ACI 318-19.pptx
 
DEVICE DRIVERS AND INTERRUPTS SERVICE MECHANISM.pdf
DEVICE DRIVERS AND INTERRUPTS  SERVICE MECHANISM.pdfDEVICE DRIVERS AND INTERRUPTS  SERVICE MECHANISM.pdf
DEVICE DRIVERS AND INTERRUPTS SERVICE MECHANISM.pdf
 
2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.
2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.
2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.
 
Mine Environment II Lab_MI10448MI__________.pptx
Mine Environment II Lab_MI10448MI__________.pptxMine Environment II Lab_MI10448MI__________.pptx
Mine Environment II Lab_MI10448MI__________.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!?