SlideShare a Scribd company logo
JCache
(JSR107)
David Brimley
The standard for Java Caching
Who is this guy?
Senior Solutions Architect @ Hazelcast
Java Developer for 17 years
@dbrimley
In Memory Data Grids for 8 years
Worked for Investment Banks
Started out coding Basic on a Commodore Vic-20
My fav computer was my old BBC Model B
Long suffering Spurs fan.
HSBC, Nomura, Credit Suisse, BZW, RBoS
Oracle Coherence 4 Years
Pivotal Gemfire 4 Years
David Brimley
Runs HUGL (Hazelcast User Group London)
Low latency trading systems
What we’ll cover…
• Why Caching?
• Introduction to JCache.
• Using Caches.
• Entry Processors.
• Listeners.
• Annotations.
• Missing Bits.
• Questions.
Who uses caching?

Quick Show of hands
Why Caching?
Why Caching?
The Speed Factor (Memory .v. Disk)
L1 cache reference 0.5 ns
Branch mispredict 5.0 ns
L2 cache reference 7.0 ns
Mutex lock/unlock 25.00 ns
Main memory reference 100.00 ns
Compress 1k bytes with ZupZ 3,000.00 ns
Send 1k bytes over 1Gpbs network 10,000.00 ns 0.01 ms
Read 4k randomly from SSD 150,000.00 ns 0.15 ms
Read 1 MB sequentially from memory 250,000.00 ns 0.25 ms
Round trip within same datacenter 500,000.00 ns 0.50 ms
Read 1 MB sequentially from SSD 1,000,000.00 ns 1.00 ms
Disk seek 10,000,000.00 ns 10.00 ms
Read 1 MB sequentially from disk 20,000,000.00 ns 20.00 ms
Send packet CA->Netherlands->CA 150,000,000.00 ns 150.00 ms
https://gist.github.com/jboner/2841832
Why Caching?
Graph of Memory Prices Decreasing with Time (1957-2014)
http://www.jcmit.com/mem2014.htm
The Cost Factor
Why Caching?
Lots of Use Cases
Slow Database
HTTP Proxy
Browser
Persistence Framework
Disk
Application
Hard to scale Database
Lots of Cache Types
Local Cache
Data Grid
Document Store
JPA Second Level
JPA First Level
Introduction to
JCache
Introduction to JCache
• Caching for the Java Platform

• Produced via the JCP / JSR107

• Ratified March 2014

• 10 years in the making.

• Works with SDK.

• Spec Leads: Greg Luck, Brian Oliver
java.util.Map (Java 6/7)
Key-Value Based API
Supports Atomic Updates
Entries Don’t Expire
Entries Aren’t Evicted
Entries Stored On-Heap
Store-By-Reference
https://gist.github.com/jboner/2841832
Introduction to JCache
Map .v. Cache
javax.cache.Cache (Java 6)
Key-Value Based API
Supports Atomic Updates
Entries May Expire
Entries May Be Evicted
Entries Stored Anyware (ie: topologies)
Store-By-Value and Store-By-Reference
Supports Integration (ie: Loaders/Writers)
Supports Observation (ie: Listeners
Entry Processors
Statistics
JCache makes NO

assumptions about
topology.



Single Process or
Distributed
Introduction to JCache
Introduction to JCache
• JCP Project

http://jcp.org/en/jsr/detail?id=107

• Source Code

https://github.com/jsr107

• Forum

https://groups.google.com/forum/?
fromgroups#!forum/jsr107

JSR107 TCK Compliant Vendors
Introduction to JCache
https://jcp.org/aboutJava/communityprocess/implementations/jsr107/index.html
I pity the fool that claims
to support JCache without
TCK compliance
As of 5th March 2015
Introduction to JCache
Something to remember when comparing vendors of
distributed caches…
Do NOT Benchmark
with a single
instance!
Using Caches
Using Caches
<dependency>

<groupId>javax.cache</groupId>

<artifactId>cache-api</artifactId>

<version>1.0.0</version>

</dependency>
Maven Central
Using Caches
Classes
Caching

“service loader”

CachingProvider

“SPI Implementation”

CacheManager

“manager of caches”

Cache

“interface to a Cache”

Using Caches
Classes
Code Walkthrough
Entry Processors
Entry Processors
Compute in place
• Atomic Operations in situ of data.
• Eliminate Round-Trips (if distributed)
• Lock Free
• Needs Serialisation (if distributed)
Application Application
Cache Cache
Entry Processors
Classes
Code Walkthrough
Listeners
Listeners
Callbacks for events in Cache
• Follows Observer Pattern

• Interface per event type

• Created, Updated, Removed, Expired

• Iterations of Events passed back

• MutableCacheEntryListenerConfiguration
Listeners
Classes
Code Walkthrough
Cache Loaders /
Writers
Cache Loaders / Writer
Cache Misses / Cache Persist
Application
Cache
Backing Store
Cache Loaders / Writer
Classes
Code Walkthrough
Annotations
Annotations
Spring 4.1, Guice, CDI
• @CacheResult

• @CachePut

• @CacheRemove

• @CacheRemoveAll


Annotations
Classes
Code Walkthrough
Missing Bits
Missing Bits
The Future of JCache
• Async API

• Query

• JEE 8

• Servlet 4.0 (Session Cache)

• Java 8 Lang Features (Lambda/Streams)
Questions ?
JCache -  It's finally here
HAZELCAST
• Free London Training
• Hazelcast User Group
• Visit our Booth

Visit our Booth

5th Floor



Get Free Training (Canary Wharf, Thursday 12th March)

http://hazelcast.com/events/

Join the Hazelcast User Group London (HUGL)

http://www.meetup.com/Hazelcast-User-Group-London-HUGL/
Download Hazelcast, the leading open source IMDG
http://www.hazelcast.org
THANK YOU.
@dbrimley
david@hazelcast.com

More Related Content

PPT
Cluster your application using CDI and JCache - Jonathan Gallimore
PDF
JCache (JSR107) - QCon London 2015 & JBCNConf Barcelona 2015
PDF
An Introduction to Cassandra on Linux
PDF
Building Antifragile Applications with Apache Cassandra
PDF
Using MySQL in Automated Testing
PPTX
Classical Distributed Computing Studies. Washington DC Apache Spark Interacti...
PDF
Using JCache to speed up your apps
PDF
In-memory No SQL- GIDS2014
Cluster your application using CDI and JCache - Jonathan Gallimore
JCache (JSR107) - QCon London 2015 & JBCNConf Barcelona 2015
An Introduction to Cassandra on Linux
Building Antifragile Applications with Apache Cassandra
Using MySQL in Automated Testing
Classical Distributed Computing Studies. Washington DC Apache Spark Interacti...
Using JCache to speed up your apps
In-memory No SQL- GIDS2014

Similar to JCache - It's finally here (20)

PDF
PDF
What to expect from Java 9
PPTX
IMC Summit 2016 Breakout - Greg Luck - How to Speed Up Your Application Using...
PDF
Nodejs - Should Ruby Developers Care?
PDF
Optimizing Latency-Sensitive Queries for Presto at Facebook: A Collaboration ...
PPTX
Playframework + Twitter Bootstrap
PDF
Java EE 7 Soup to Nuts at JavaOne 2014
PPTX
JavaOne 2014 - Scalable JavaScript Applications with Project Nashorn [CON6423]
PDF
Codemotion 2015 Infinispan Tech lab
PPTX
Programming in HTML5 With Java Script and CSS3
PDF
Java 23 and Beyond - A Roadmap Of Innovations
PPTX
Setting up a free open source java e-commerce website
ODP
GlassFish and JavaEE, Today and Future
PDF
Caching and JCache with Greg Luck 18.02.16
PDF
Breathing new life into JSP with OSGi? Why!!! - R Auge
PDF
Java EE 6, Eclipse, GlassFish @EclipseCon 2010
PDF
PDF
Play 2 Java Framework with TDD
PPTX
Java 7 Whats New(), Whats Next() from Oredev
PDF
Java EE 6, Eclipse @ EclipseCon
What to expect from Java 9
IMC Summit 2016 Breakout - Greg Luck - How to Speed Up Your Application Using...
Nodejs - Should Ruby Developers Care?
Optimizing Latency-Sensitive Queries for Presto at Facebook: A Collaboration ...
Playframework + Twitter Bootstrap
Java EE 7 Soup to Nuts at JavaOne 2014
JavaOne 2014 - Scalable JavaScript Applications with Project Nashorn [CON6423]
Codemotion 2015 Infinispan Tech lab
Programming in HTML5 With Java Script and CSS3
Java 23 and Beyond - A Roadmap Of Innovations
Setting up a free open source java e-commerce website
GlassFish and JavaEE, Today and Future
Caching and JCache with Greg Luck 18.02.16
Breathing new life into JSP with OSGi? Why!!! - R Auge
Java EE 6, Eclipse, GlassFish @EclipseCon 2010
Play 2 Java Framework with TDD
Java 7 Whats New(), Whats Next() from Oredev
Java EE 6, Eclipse @ EclipseCon
Ad

More from Hazelcast (20)

PDF
Hazelcast 3.6 Roadmap Preview
PDF
Time to Make the Move to In-Memory Data Grids
PDF
The Power of the JVM: Applied Polyglot Projects with Java and JavaScript
PDF
Speed Up Your Existing Relational Databases with Hazelcast and Speedment
PDF
Shared Memory Performance: Beyond TCP/IP with Ben Cotton, JPMorgan
PDF
Applying Real-time SQL Changes in your Hazelcast Data Grid
PDF
WAN Replication: Hazelcast Enterprise Lightning Talk
PDF
JAAS Security Suite: Hazelcast Enterprise Lightning Talk
PDF
Hazelcast for Terracotta Users
PDF
Extreme Network Performance with Hazelcast on Torusware
PDF
Big Data, Simple and Fast: Addressing the Shortcomings of Hadoop
PDF
JAXLondon - Squeezing Performance of IMDGs
PDF
OrientDB & Hazelcast: In-Memory Distributed Graph Database
PDF
How to Use HazelcastMQ for Flexible Messaging and More
PDF
Devoxx UK 2014 High Performance In-Memory Java with Open Source
PDF
JSR107 State of the Union JavaOne 2013
PDF
Jfokus - Hazlecast
PDF
In-memory Data Management Trends & Techniques
PDF
How to Speed up your Database
PDF
Hazelcast HUGL
Hazelcast 3.6 Roadmap Preview
Time to Make the Move to In-Memory Data Grids
The Power of the JVM: Applied Polyglot Projects with Java and JavaScript
Speed Up Your Existing Relational Databases with Hazelcast and Speedment
Shared Memory Performance: Beyond TCP/IP with Ben Cotton, JPMorgan
Applying Real-time SQL Changes in your Hazelcast Data Grid
WAN Replication: Hazelcast Enterprise Lightning Talk
JAAS Security Suite: Hazelcast Enterprise Lightning Talk
Hazelcast for Terracotta Users
Extreme Network Performance with Hazelcast on Torusware
Big Data, Simple and Fast: Addressing the Shortcomings of Hadoop
JAXLondon - Squeezing Performance of IMDGs
OrientDB & Hazelcast: In-Memory Distributed Graph Database
How to Use HazelcastMQ for Flexible Messaging and More
Devoxx UK 2014 High Performance In-Memory Java with Open Source
JSR107 State of the Union JavaOne 2013
Jfokus - Hazlecast
In-memory Data Management Trends & Techniques
How to Speed up your Database
Hazelcast HUGL
Ad

Recently uploaded (20)

PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PPTX
ai tools demonstartion for schools and inter college
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PPTX
ManageIQ - Sprint 268 Review - Slide Deck
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
System and Network Administration Chapter 2
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PPTX
L1 - Introduction to python Backend.pptx
Adobe Illustrator 28.6 Crack My Vision of Vector Design
ai tools demonstartion for schools and inter college
Odoo Companies in India – Driving Business Transformation.pdf
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
ManageIQ - Sprint 268 Review - Slide Deck
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
Wondershare Filmora 15 Crack With Activation Key [2025
Design an Analysis of Algorithms I-SECS-1021-03
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
VVF-Customer-Presentation2025-Ver1.9.pptx
Which alternative to Crystal Reports is best for small or large businesses.pdf
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Upgrade and Innovation Strategies for SAP ERP Customers
System and Network Administration Chapter 2
Operating system designcfffgfgggggggvggggggggg
How to Choose the Right IT Partner for Your Business in Malaysia
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
Navsoft: AI-Powered Business Solutions & Custom Software Development
L1 - Introduction to python Backend.pptx

JCache - It's finally here