9

Are there any advantages and/or disadvantages to using either JCache (JSR 107) or the Memcache API with Google App Engine? If so, what are they?

Taylor Leese
  • 51,004
  • 28
  • 112
  • 141

1 Answers1

5

Using the JCache API as defined by JSR 107 is exactly the same as using the GAE Memcache API. That is, the GAE Memcache API looks and act just like the JCache API in your Java code.

Quoth the docs:

The App Engine Java SDK supports JCache, a proposed interface standard for memory caches, as an interface to the App Engine memcache. This interface is described by JSR 107. Since this is not yet an official standard, App Engine provides this interface using the net.sf.jsr107 interface package.

This means that if you've already got a Java app that uses JCache, or should you decide to move your app off of App Engine, you can do it without changing any of your Memcache code.

Jason Hall
  • 20,632
  • 4
  • 50
  • 57
  • 1
    I understand that part, but I'm wondering if there's anything you can't do with JCache that you could do with the Memcache API. – Taylor Leese Jun 06 '10 at 07:24
  • 2
    It looks like the low-level memcache API has some extra features that aren't in JCache, like methods for atomically incrementing/decrementing integer counters, and statistics. There are also some JCache methods unsupported by GAE's Memcache. See http://code.google.com/appengine/docs/java/memcache/usingjcache.html#Features_Not_Supported – Jason Hall Jun 06 '10 at 08:15
  • Sounds like JCache is basically dead (http://bluxte.net/musings/2009/09/10/what-happened-jcache-aka-jsr-107). – Taylor Leese Jun 27 '10 at 08:23
  • 1
    According to [a recent comment](http://bluxte.net/musings/2009/09/10/what-happened-jcache-aka-jsr-107#comment-2812) on that post, [it's just come back to life](http://groups.google.com/group/jsr107?pli=1)! – Tom Anderson May 12 '11 at 11:34