
Memcache is the de-facto distributed caching server used to scale many web2.0 sites today. With the requirement to support a very large number of users as sites grow, memcache aids scalability by effectively cutting down on MySQL traffic and improving response times. One of the beauties of memcache is that while its interface is incredibly simple, it is so robust and flexible that it can do nearly anything. Memcache can also be used as a distributed locking service. Memcache locking is used for controlling some problems which arise while doing some projects. The lost update problem is resolved by distributed locking.
The easiest solution is to have a lock which must be acquired in order to do the read/update/write operations. Locks are great with a set of threads but once you break out of the context of a single machine, you need something distributed. There are many set of codes which can do this.