Saying *NO* to stale data

Jacques Caron jc at oxado.com
Wed Jul 5 17:55:06 UTC 2006


At 17:44 05/07/2006, Michael Carter wrote:
>With even simple apps with very small user bases, it would be almost 
>impossible to avoid deadlock situations.

If you manipulate only one user at a time (i.e. any process only ever 
sets a single lock at a given time), there can't be any deadlock, the 
requests are just serialized. If you manipulate multiple users "in 
one go", you would just need to always lock them in the same order, 
or use a single more or less "global" lock (remember you only need it 
for updates). But I guess it all depends on your code and data structure.

>Well, its wasteful because I know what that data is

Actually, no, you don't, that's the problem you're trying to solve: 
you think you know what the data is, but you may not (when you have 
another update on the way on the same object).

Jacques.




More information about the memcached mailing list