6

I'm getting ready to start working on performance in an application which will eventually be running distributed, but currently is in [greenfield] development.

I'd like to be able to introduce caching without either selecting or committing to a specific library, so I am wondering whether there is a caching facade library (analogous to slf4j for logging) already in existence that will allow me to make that decision at a later date.

Matt Mills
  • 8,692
  • 6
  • 40
  • 64

3 Answers3

3

There is also a Java standard: JSR 107: JCACHE - Java Temporary Caching API. Pretty much dead, but there was some movement half year ago. Also there is quite a lot happens in the source repository. EhCache supports this JSR natively.

If you are using Spring, it has a great caching abstraction.

Tomasz Nurkiewicz
  • 334,321
  • 69
  • 703
  • 674
  • JSR107's javax.cache appears to be exactly what I'm looking for. Would you mind expounding on "pretty much dead"? – Matt Mills Jan 26 '12 at 17:38
  • @arootbeer: look at the JSR history, last item in 2001, although there is some note from 2011.05.04. Also looks like there is momentum in the source code repository (added link to an answer). – Tomasz Nurkiewicz Jan 26 '12 at 17:43
  • On looking deeper, JSR 107 is being included in Java EE 7 (see JSR 342 - http://jcp.org/en/jsr/summary?id=342). Here's Greg Luck's [one of the spec leads on JSR 107] introduction to it: http://gregluck.com/blog/archives/2011/10/javax-cache-the-new-java-caching-standard/. His blog also has some other interesting discussion about why JSR107 was introduced in 2001 and has languished for 11 years. – Matt Mills Jan 26 '12 at 18:06
1

If you are using Spring it has a cache abstraction.

Have a look at the blog entry here too which introduced me to the concept.

Paul Whelan
  • 16,574
  • 12
  • 50
  • 83
  • We're not using Spring, and it appears (from a quick glance) that their abstraction is only understood by Spring. Can you comment? – Matt Mills Jan 26 '12 at 17:28
0

One of the popular cache implementations is EhCache. You can also take a look on Terracotta cache (terracota has a lot of sub-projects - see the cache).

AlexR
  • 114,158
  • 16
  • 130
  • 208
  • I'm familiar with EhCache, Google Cache, JCS - but I'm not the only one making the [eventual] decision. I do need to get *something* in place *soon*, which is why I'm hoping to find a facade. – Matt Mills Jan 26 '12 at 17:25