IdP Memcached StorageService implementation

Manuel Haim haim at hrz.uni-marburg.de
Mon Aug 1 09:43:04 BST 2011


Am 31.07.2011 18:03, schrieb Peter Schober:
> Are you replicating memcached's content between memcached instances
> somehow, e.g. using the repcached patches[1]? If not how is this an
> alternative to Terracotta (as you'd only be shifting a SPOF from one
> IdP to one memcached instaance.)
>
> I know SimpleSAMLphp can be set up to use replicated memcached
> instances (though I can't find the docs on the current site) but the
> replication code had to be added to SimpleSAMLphp, AFAIR.
> -peter
>
> [1] http://repcached.lab.klab.org/


Hi Peter,

thanks for the repcached link. (There seem to be various clustered cache
solutions which speak the memcached protocol, see [1]; we only tested an
Infinispan cluster for this, but then stayed with memcached.)

Up to now, we do not replicate memcached's contents, but we spread data
over multiple memcached instances (by means of a hash function, which is
the default of the spymemcached library we are using), so each item is
stored only once. If a memcached node fails, its data may be lost, but
new data for this node will be stored on another node and retrieved from
there, so the cluster keeps working.

Additionally, with the IdP Memcached StorageService, each IdP keeps a
local cache for technical reasons (i.e. Java object references within
one IdP node must stay the same for each get() call). This also has the
intended side effect that, once the memcached entry is lost, the local
value will be used. As we use sticky sessions on the load balancer for
the user side, this guarantees that the user will always come back to
the same IdP node and keep his session even after a memcached node
failed. Once the user authenticates to another SP, the selected IdP node
will write the local session to memcached again, so it will be available
to the other IdP nodes for back-channel requests.

A different solution which incorporates memcached replication on our IdP
Memcached StorageService's side is being discussed (like building a
memcached cluster with one active and several passive nodes like in
Terracotta, or a memcached cluster where each item is stored on multiple
but not all nodes). This, however, may not come into consideration as
long as our current solution proves working.

-Manuel

[1] Memcached replication options?
http://www.quora.com/Memcached-replication-options



More information about the users mailing list