views:

242

answers:

1

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?

+2  A: 

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
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
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
Sounds like JCache is basically dead (http://bluxte.net/musings/2009/09/10/what-happened-jcache-aka-jsr-107).
Taylor Leese