DESCRIPTION

add ehcache plugin to spymemcached for front cache.

Change-Id: I9084c1d3e978e2483b329aef2ded3f7dc6f9db96


COMMENTS

author: Noah Dean
date: 2010-11-10 18:35:31.598000000

Uploaded patch set 2.

-------------------------------------
author: Noah Dean
date: 2010-11-10 22:27:50.640000000

Patch Set 2: Fails

The build fails -- apparently it needs to be updated with some dependencies.

-------------------------------------
author: Jakob Lozano
date: 2010-11-11 17:10:53.219000000

Patch Set 2: I would prefer that you didn't submit this

What problem is this change solving?

I see there's a default 5 ms timeout on the ehcache.  Is this to reduce load on the memcached servers?

I'm uncomfortable with this change for a couple of reasons:

1) The semantics of updating two caches isn't obvious.  How should should a failure to update from one cache be reflected in the return result?  How should add() behave if one cache has a key and the other doesn't, or the value you're setting is different than the value in one of the caches.
2) Its mixing in a completely new project in a well established memcached client.  I for one, don't need or care about ehcache.

I think a better design would be for the ehcache implementation to implement MemcachedClientIF as a completely separate implementation.  Then write a ChainedMemecachedClient that also implements MemcachedClientIF that takes two MemcachedClientIF arguments and it does the necessary get(), add(), set() behavior, failing through to the secondary cache if necessary.

This feels like you're bolting on some additional functionality you need that is better abstracted externally from the memcached library.

BTW, I've written a general Scala Cache API that abstracts out this stuff that can be backed by memcached, ConcurrentMap, ehcache, etc.  I'm trying to get it open sourced.

-------------------------------------
author: Andreas Short
date: 2010-11-20 04:13:06.980000000

Patch Set 2:

Not a review, just to answer Blair's message...

This patch was actually solicited, as there have been other requests for similar functionality.  We have something like this in the moxi proxy, and it's been useful to some.

The intent with this is to be able to use all of spymemcached, but have a short period of time, in some cases as short as a second, where an incoherent cache is okay and the speedup by being in-process is a benefit.

Will review code soon...

-------------------------------------
author: Andreas Short
date: 2010-11-20 04:13:10.754000000

Patch Set 2:

Not a review, just to answer Blair's message...

This patch was actually solicited, as there have been other requests for similar functionality.  We have something like this in the moxi proxy, and it's been useful to some.

The intent with this is to be able to use all of spymemcached, but have a short period of time, in some cases as short as a second, where an incoherent cache is okay and the speedup by being in-process is a benefit.

Will review code soon...

-------------------------------------
author: Jakob Lozano
date: 2010-11-20 07:08:36.980000000

Patch Set 2:

Matt,

Thanks for the background, I appreciate it.

In that case then, I suggest having a FrontCacheIF that the ehcache implements.

Personally, we don't use ehcache in our infrastructure, but we do use Google Guava concurrent maps which have LRU behavior and soon fixed size behavior, that I would be interested in fronting.  So a general interface that one can plug in or register a FrontCacheIF implementation (ehcache or Guava concurrent map) would be useful.

-------------------------------------
author: Noah Dean
date: 2011-05-23 23:30:15.517000000

Patch Set 2: Abandoned

This has been sitting around with -1/-1 with no new work going in.  Going to toss it to the abandoned list.

-------------------------------------
