Shevek (shevek) wrote,
Shevek
shevek

I've been looking into java caching systems.

JCS (Apache) has a really nice API and architecture, but the memory overhead looks disgusting, and I'm not convinced that anybody uses it. If it wasn't for those two issues, I'd use it.

EhCache is not bad. The API methods never _quite_ do what one wants, for example, it implements Map, but it's not Map<Key,Value>, it's Map<Key,Element<Value>>, and it's written without generics. Also, cache.setCacheLoader(...) does not cause the cache loader to be used on future get() calls. For all of this, it's relatively easy to bend the API to do what I want.

JSR107 could be worse. EhCache is tied quite closely to it. There is a JSR107 project on sourceforge, but nobody seems to "own" it and google doesn't see it.

I'm not using OSCache or SwarmCache, since they seem to target specific application domains which do not include my application. They may also be good general purpose caches, I don't know.

On the whole, the situation could be worse.

I would like:

  • Use of generics, including in CacheLoader.
  • Use of CacheLoader in get() calls.
  • Some sort of CacheLoaderAdapter provided by standard.
  • Different semantics for Map.get() and Cache.getElement() calls.
Subscribe
  • Post a new comment

    Error

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 3 comments