Monday Oct 17, 2011

javax.cache explained

Another day, another Java EE 7 component making serious progress - javax.cache (aka JCache, JSR 107) is another JSR that has reached the draft status as Greg Luck, the co-spec lead shares in his recent blog post.

The specification defines a CacheManager API which references caches and their entries stored in a map-like collection enhanced with features such as transactions (optional), listeners or statistics.


The resulting API can be used in both Java SE and Java EE and is distributed cache aware. One benefit of having waited so long for this JSR to complete is that we'll get a set of annotations usable in managed environments (Java EE and Spring).

Ehcache will be offering the reference implementation with other implementations planned by Oracle, JBoss, IBM and others.

Greg also has a short video interview coming out of his JavaOne 2011 session in which he explains how simple it will be to move from one implementation to another.

Friday Apr 29, 2011

Java EE 7 - what about caching?

JCache (JSR 107, Java Temporary Caching API) has been incomplete and dormant for a while. With JavaEE 7 picking up steam and addressing cloud scenarios such as PaaS, the co spec leads (EHCache's Greg Luck and Oracle's Cameron Purdy) have agreed to do get back to work and complete JCache to provide Java EE with a general purpose caching API. You can find an evolving draft version of the specification and get a good level of details about what's going on on this recent post by Greg.


Fast-forward 240 JSRs and we now have JSR 347: Data Grids for the Java Platform, submitted by JBoss and with a goal to "build upon and extend JSR-107 (JCACHE) API" to adress use-cases such as distributed caching (2nd level caching for JPA for instance) or transient session state (ActiveCache for GlassFish would be a good example of that) and provide standard means of distributing and replicating data. More background on Manik's blog.

Voting by the JCP Executive Committee on JSR 347 is now going on with results due on May 9th. The proposed schedule for this JSR targets an Early Draft of the specification by December 2011 and a Final Release by September 2012 (in time for Java EE 7).

Wednesday May 06, 2009

This Week's Webinar - Ehcache, Architecture, Features and Usage Patterns


This week's webinar is on Ehcache, the popular java-based cache - #1 among GlassFish users, according to a recent informal survey. This presentation, by Greg Luck, its lead maintainer and the Chief Architect of, covers the theory of caching, the architecture of Ehcache, Features of the product, Usage Patterns and includes some code samples.

The presentation on Thursday, May 7th, 11am US Pacific, at TheAquarium Channel. Full details (and recordings) at the Show Page.

Saturday May 19, 2007

Memcached or ehCache? Performance Benefits of In-Memory Caching

Graph comparing memcached and ehcache

Memcached is a distributed, in-memory, cache that was popularized by LiveJournal. Memcached has good performance but it runs as a deamon (diagram) and an interesting question is whether local, cooperating, in-memory caches might do better.

Greg implemented this approach in ehCache (diagram, Wotif.COM) and recently ran some comparisons that suggest ehCache is much faster.

Greg gave a full report on this topic in TS-6039 at JavaOne but the slides are not yet online. Fortunately he just published a short summary in his blog site (see comparison graph). There was also a micro-session at CommunityDay and I'll let you know when we push the slides to the Virtual GlassFish Day page.