Using membase/memcached buckets for user state
Can someone give me an example of how they are using membase to manage user state?
I mean... Assuming you have a cluster of servers load balanced and want to avoid sticky sessions, and you want to use membase (or plain old memcached for that matter) behind as a "session state" layer, how would you ensure proper concurrency. The problem I'm refferring to is that you might have 2 requests coming in on different servers, both getting some object from membase, modifying it and setting it back. We've experimented with using lock objects for each data object and using CAS to make sure only one server can modify some object at a given time. It yielded poor results. Might be due to our implementation but at this point I thought to just ask before we spend any more time on this.
I know companies that have huge loads are using architectures of this kind and even specifically membase to cache live user data. I could never find anything describing exactly how their doing it though.