SlideShare a Scribd company logo
1 of 7
Download to read offline
JSR-107 (JCache)
API: javax.cache
JCache entities:
[Caching] getCachingProvider, getCache
CachingProvider getCacheManager, close...
CacheManager createCache, destroyCache, getCache...
Cache put[All], containsKey, get[All], replace,
remove[All]
Entry getKey, getValue
Spring Cache
@EnableCaching enable caching
@Cacheable cache first, invoke method if not found
@CachePut invoke method, put into cache
@CacheEvict drop from cache, invoke method
@Caching combine different annotations
@CacheConfig cache configuration
Spring 4.1+ vs JSR-107
@Cacheable @CacheResult
@CachePut @CachePut (@CacheValue)
@CacheEvict @CacheRemove
@CacheEvict(allEntries = true) @CacheRemoveAll
@CacheConfig @CacheDefaults
@EnableCaching + JSR-107 API
+ spring-context-support
Cache providers features
Local/Distrib. Non-blocking JCache Spring
● Cache2k L - + +
● Caffeine L + + +
● Coherence Community Edition + + + -
● EhCache L - + +
● Geode + - - +
● Guava L - - -
● Hazelcast + + + +
● Ignite + + + +
● Infinispan + + + +
● JCS + - + -
● Redisson (non-Pro) D + + +
Spring supported providers
Cache2k Caffeine
Couchbase EhCache 2.x
Hazelcast Infinispan
Redisson
JCache (JSR-107) – EhCache 3, Hazelcast, Infinispan etc.
Simple None
https://docs.spring.io/spring-boot/docs/current/reference/html/io.html#io.caching.provider
References
DZone Java Caching – https://dzone.com/refcardz/java-caching
A Java Geek Choosing a cache, A list of cache providers –
https://blog.frankel.ch/tag/cache/
Baeldung A Guide To Caching in Spring –
https://www.baeldung.com/spring-cache-tutorial
java T point Spring Boot Caching –
https://www.javatpoint.com/spring-boot-caching
Java Design Patterns – Caching –
https://java-design-patterns.com/patterns/caching/
etc.

More Related Content

Similar to Java Caching

Dutch php conference_apc_mem2010
Dutch php conference_apc_mem2010Dutch php conference_apc_mem2010
Dutch php conference_apc_mem2010
isnull
 

Similar to Java Caching (20)

awergaezrg
awergaezrgawergaezrg
awergaezrg
 
sakdjfhaksjfhaskjh
sakdjfhaksjfhaskjhsakdjfhaksjfhaskjh
sakdjfhaksjfhaskjh
 
salkdjfhdjkghdfkjh
salkdjfhdjkghdfkjhsalkdjfhdjkghdfkjh
salkdjfhdjkghdfkjh
 
aksdfhaskdjfhasdjkh
aksdfhaskdjfhasdjkhaksdfhaskdjfhasdjkh
aksdfhaskdjfhasdjkh
 
askldjfhaskdfj aslkdjfhaskdfhasjk askldf ashkdf
askldjfhaskdfj aslkdjfhaskdfhasjk askldf ashkdfaskldjfhaskdfj aslkdjfhaskdfhasjk askldf ashkdf
askldjfhaskdfj aslkdjfhaskdfhasjk askldf ashkdf
 
aergserga
aergsergaaergserga
aergserga
 
sergaerwga
sergaerwgasergaerwga
sergaerwga
 
Distributed caching and computing v3.7
Distributed caching and computing v3.7Distributed caching and computing v3.7
Distributed caching and computing v3.7
 
Ehcache Architecture, Features And Usage Patterns
Ehcache Architecture, Features And Usage PatternsEhcache Architecture, Features And Usage Patterns
Ehcache Architecture, Features And Usage Patterns
 
Think Distributed: The Hazelcast Way
Think Distributed: The Hazelcast WayThink Distributed: The Hazelcast Way
Think Distributed: The Hazelcast Way
 
Dutch php conference_apc_mem2010
Dutch php conference_apc_mem2010Dutch php conference_apc_mem2010
Dutch php conference_apc_mem2010
 
Consuming & embedding external content in WordPress
Consuming & embedding external content in WordPressConsuming & embedding external content in WordPress
Consuming & embedding external content in WordPress
 
Java - Persist and Replay Runtime Data
Java - Persist and Replay Runtime Data Java - Persist and Replay Runtime Data
Java - Persist and Replay Runtime Data
 
Gimme Caching - The JCache Way
Gimme Caching - The JCache WayGimme Caching - The JCache Way
Gimme Caching - The JCache Way
 
JCache Using JCache
JCache Using JCacheJCache Using JCache
JCache Using JCache
 
Grails on GAE/J
Grails on GAE/JGrails on GAE/J
Grails on GAE/J
 
JSRs 303 and 330 in Action
JSRs 303 and 330 in ActionJSRs 303 and 330 in Action
JSRs 303 and 330 in Action
 
Caching a page
Caching a pageCaching a page
Caching a page
 
Caching in asp.net mvc
Caching in asp.net mvcCaching in asp.net mvc
Caching in asp.net mvc
 
Hibernate Cache
Hibernate CacheHibernate Cache
Hibernate Cache
 

Recently uploaded

Jax, FL Admin Community Group 05.14.2024 Combined Deck
Jax, FL Admin Community Group 05.14.2024 Combined DeckJax, FL Admin Community Group 05.14.2024 Combined Deck
Jax, FL Admin Community Group 05.14.2024 Combined Deck
Marc Lester
 

Recently uploaded (20)

Abortion Pill Prices Mthatha (@](+27832195400*)[ 🏥 Women's Abortion Clinic In...
Abortion Pill Prices Mthatha (@](+27832195400*)[ 🏥 Women's Abortion Clinic In...Abortion Pill Prices Mthatha (@](+27832195400*)[ 🏥 Women's Abortion Clinic In...
Abortion Pill Prices Mthatha (@](+27832195400*)[ 🏥 Women's Abortion Clinic In...
 
Encryption Recap: A Refresher on Key Concepts
Encryption Recap: A Refresher on Key ConceptsEncryption Recap: A Refresher on Key Concepts
Encryption Recap: A Refresher on Key Concepts
 
The mythical technical debt. (Brooke, please, forgive me)
The mythical technical debt. (Brooke, please, forgive me)The mythical technical debt. (Brooke, please, forgive me)
The mythical technical debt. (Brooke, please, forgive me)
 
UNI DI NAPOLI FEDERICO II - Il ruolo dei grafi nell'AI Conversazionale Ibrida
UNI DI NAPOLI FEDERICO II - Il ruolo dei grafi nell'AI Conversazionale IbridaUNI DI NAPOLI FEDERICO II - Il ruolo dei grafi nell'AI Conversazionale Ibrida
UNI DI NAPOLI FEDERICO II - Il ruolo dei grafi nell'AI Conversazionale Ibrida
 
Your Ultimate Web Studio for Streaming Anywhere | Evmux
Your Ultimate Web Studio for Streaming Anywhere | EvmuxYour Ultimate Web Studio for Streaming Anywhere | Evmux
Your Ultimate Web Studio for Streaming Anywhere | Evmux
 
GraphSummit Milan - Neo4j: The Art of the Possible with Graph
GraphSummit Milan - Neo4j: The Art of the Possible with GraphGraphSummit Milan - Neo4j: The Art of the Possible with Graph
GraphSummit Milan - Neo4j: The Art of the Possible with Graph
 
Incident handling is a clearly defined set of procedures to manage and respon...
Incident handling is a clearly defined set of procedures to manage and respon...Incident handling is a clearly defined set of procedures to manage and respon...
Incident handling is a clearly defined set of procedures to manage and respon...
 
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
 
BusinessGPT - Security and Governance for Generative AI
BusinessGPT  - Security and Governance for Generative AIBusinessGPT  - Security and Governance for Generative AI
BusinessGPT - Security and Governance for Generative AI
 
GraphSummit Milan - Visione e roadmap del prodotto Neo4j
GraphSummit Milan - Visione e roadmap del prodotto Neo4jGraphSummit Milan - Visione e roadmap del prodotto Neo4j
GraphSummit Milan - Visione e roadmap del prodotto Neo4j
 
Automate your OpenSIPS config tests - OpenSIPS Summit 2024
Automate your OpenSIPS config tests - OpenSIPS Summit 2024Automate your OpenSIPS config tests - OpenSIPS Summit 2024
Automate your OpenSIPS config tests - OpenSIPS Summit 2024
 
Lessons Learned from Building a Serverless Notifications System.pdf
Lessons Learned from Building a Serverless Notifications System.pdfLessons Learned from Building a Serverless Notifications System.pdf
Lessons Learned from Building a Serverless Notifications System.pdf
 
Abortion Pill Prices Turfloop ](+27832195400*)[ 🏥 Women's Abortion Clinic in ...
Abortion Pill Prices Turfloop ](+27832195400*)[ 🏥 Women's Abortion Clinic in ...Abortion Pill Prices Turfloop ](+27832195400*)[ 🏥 Women's Abortion Clinic in ...
Abortion Pill Prices Turfloop ](+27832195400*)[ 🏥 Women's Abortion Clinic in ...
 
Effective Strategies for Wix's Scaling challenges - GeeCon
Effective Strategies for Wix's Scaling challenges - GeeConEffective Strategies for Wix's Scaling challenges - GeeCon
Effective Strategies for Wix's Scaling challenges - GeeCon
 
Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024
Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024
Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024
 
Jax, FL Admin Community Group 05.14.2024 Combined Deck
Jax, FL Admin Community Group 05.14.2024 Combined DeckJax, FL Admin Community Group 05.14.2024 Combined Deck
Jax, FL Admin Community Group 05.14.2024 Combined Deck
 
From Knowledge Graphs via Lego Bricks to scientific conversations.pptx
From Knowledge Graphs via Lego Bricks to scientific conversations.pptxFrom Knowledge Graphs via Lego Bricks to scientific conversations.pptx
From Knowledge Graphs via Lego Bricks to scientific conversations.pptx
 
Abortion Pill Prices Germiston ](+27832195400*)[ 🏥 Women's Abortion Clinic in...
Abortion Pill Prices Germiston ](+27832195400*)[ 🏥 Women's Abortion Clinic in...Abortion Pill Prices Germiston ](+27832195400*)[ 🏥 Women's Abortion Clinic in...
Abortion Pill Prices Germiston ](+27832195400*)[ 🏥 Women's Abortion Clinic in...
 
[GeeCON2024] How I learned to stop worrying and love the dark silicon apocalypse
[GeeCON2024] How I learned to stop worrying and love the dark silicon apocalypse[GeeCON2024] How I learned to stop worrying and love the dark silicon apocalypse
[GeeCON2024] How I learned to stop worrying and love the dark silicon apocalypse
 
Software Engineering - Introduction + Process Models + Requirements Engineering
Software Engineering - Introduction + Process Models + Requirements EngineeringSoftware Engineering - Introduction + Process Models + Requirements Engineering
Software Engineering - Introduction + Process Models + Requirements Engineering
 

Java Caching

  • 1.
  • 2. JSR-107 (JCache) API: javax.cache JCache entities: [Caching] getCachingProvider, getCache CachingProvider getCacheManager, close... CacheManager createCache, destroyCache, getCache... Cache put[All], containsKey, get[All], replace, remove[All] Entry getKey, getValue
  • 3. Spring Cache @EnableCaching enable caching @Cacheable cache first, invoke method if not found @CachePut invoke method, put into cache @CacheEvict drop from cache, invoke method @Caching combine different annotations @CacheConfig cache configuration
  • 4. Spring 4.1+ vs JSR-107 @Cacheable @CacheResult @CachePut @CachePut (@CacheValue) @CacheEvict @CacheRemove @CacheEvict(allEntries = true) @CacheRemoveAll @CacheConfig @CacheDefaults @EnableCaching + JSR-107 API + spring-context-support
  • 5. Cache providers features Local/Distrib. Non-blocking JCache Spring ● Cache2k L - + + ● Caffeine L + + + ● Coherence Community Edition + + + - ● EhCache L - + + ● Geode + - - + ● Guava L - - - ● Hazelcast + + + + ● Ignite + + + + ● Infinispan + + + + ● JCS + - + - ● Redisson (non-Pro) D + + +
  • 6. Spring supported providers Cache2k Caffeine Couchbase EhCache 2.x Hazelcast Infinispan Redisson JCache (JSR-107) – EhCache 3, Hazelcast, Infinispan etc. Simple None https://docs.spring.io/spring-boot/docs/current/reference/html/io.html#io.caching.provider
  • 7. References DZone Java Caching – https://dzone.com/refcardz/java-caching A Java Geek Choosing a cache, A list of cache providers – https://blog.frankel.ch/tag/cache/ Baeldung A Guide To Caching in Spring – https://www.baeldung.com/spring-cache-tutorial java T point Spring Boot Caching – https://www.javatpoint.com/spring-boot-caching Java Design Patterns – Caching – https://java-design-patterns.com/patterns/caching/ etc.