Managing a list in membase
Thu, 11/11/2010 - 01:08
Hi,
I have a question not about an issue but about how to implement a solution to a common problem:
Lets say I have a user, and the user has a list of ~10-100 items. I'd like to add, remove and iterate the user's items. What's the most efficient way of solving/implementing this in membase?
Thank You,
Tom.
Thanks for your inquiry Tom.
Currently, Membase acts exactly like memcached. You can use the "append" operation to atomically place some data at the end of an item:
set pkrug 0 0 1
a
STORED
append pkrug 0 0 1
b
STORED
get pkrug
VALUE pkrug 0 2
ab
END
You can also use the 'CAS' operator to essentially "lock" an item while you read it in, edit it and write it back.
In an upcoming release (though not the next one) we will be adding direct support for 'lists' and 'sets' which give you a much wider range of capabilities to working with this type of dataset.
Perry
Forum support is great for free but sometimes you need a guaranteed response time and dedicated resources for your questions or issues.
Consider purchasing enterprise-level support from Couchbase: http://www.couchbase.com/products-and-services/overview
Call or email "sales -at- couchbase-dot- com" today!