Using membase/memcached buckets for user state
Hi,
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.
Cheers,
DB
Hi there DB, we actually have a number of customers using Membase for this exact purpose. Using 'CAS' is the most common way to perfom the read-modify-write process and can certainly be tuned for very high performance. Depending on the operations you want to perform on the data, there are also atomic, srever-side operations that can be used as well (append, prepend, incr, decr)
Hope that helps...
Perry
No one?
How do you ensure validity of concurrent requests in NoSQL DBs in general and membase specifically? Somebody HAD to tackle this before...