Shevek (shevek) wrote,

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.

  • (no subject)

    Woken up at 3am, sounds like we're into a storm. This is still the overture, it's been thundering tremendously for 30 minutes now, and flashing with…

  • (no subject)

    The Russian greeted me with a smile which grew ever broader as I came into the room. It took me a minute to switch my head into the right language -…

  • (no subject)

    People here show their religion in their driving. Actually, they show that they have religion by driving at all, one has to put one's faith in some…

  • Post a new comment


    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.