The best practice is to not use memached at all for this. It is a cache, if
you store something in it, you are in no way guaranteed that it will be
there the next time you ask for it. It is temporary, not permanent, and as
such an extremely bad match for a distributed lock where it is absolutely
critical that you do not lose data.


/Henrik

On Thu, Mar 12, 2009 at 19:30, Yigit Boyar <[email protected]> wrote:

>
> hi all,
>
> I'm developing a software where memcached is also used as locking server.
>
> The problem is that, i wanna make this fail safe; which basically means if
> the memcached server goes down, another one starts and the locks are
> transformed. This basically handled by keeping two instances up, one as
> master and if the master dies, slave becomes master and an new slave comes
> live.
>
> This is my guess, but I'm looking for some good best practices not to
> invent wheel from scratch.
>
> So is there any link you can provide where a best practice for memcached
> based locking is present ?
>
> btw. i'm using php in a distributed environment.
>
> thnks.
>

Reply via email to