php-memcache, delete, expiration questions, ideas

Veres Lajos vlajos at ludens.elte.hu
Mon Dec 5 10:28:57 UTC 2005


Hello,

On Mon, 5 Dec 2005, mike wrote:

> isn't that the point of a "distributed cache" mechanism though?
> otherwise it would be a replicating cache... from all the terminology
> I've had the pleasure of dealing with :)

Yes, we are using memcached for 2 things:
-session, we would like to store all sessiondata in all servers
-caching, we would like to distribute cache data between servers

I guess only the "caching" matches to this "distributed cache" mechanism.

Sorry for my weak english, maybe my phrases arent as clear as they should be.

>
> I wouldn't expect the pecl API to do that either, from what I
> understand it doesn't cache all data on all servers, it caches it on a
> specific server (hence having the mapping table of available servers)
>
> I could be off my rocker though. That's what it sounds like to me though.

Yes. As I seen none of the APIs supports write the same (key,value) to all 
servers.

But with the stable pecl API, it isnt as hard to workaround this.
It supports direct write to servers.

The greatest solution will be instead of storing all session 
in all cache, storing only each session in two server.
Duplication should be enought safety, but then the server choosing hash 
mechanism will be more complex. I think.
It should ensure if one of session holder crashes, then the next "get" 
will find the session in the secondary holder.

What do you think, there is any simpler solution for avoid session loss 
when any server crashes?

-- 
Veres Lajos
vlajos at ludens.elte.hu
+36 20 438 5909


More information about the memcached mailing list