What's the best way to implement a (consistent) list type on top of memcached?
-
With some googling I've come across three ways: 1) Atomic operations via lock keys 2) STM (Software Transactional Memory) with CAS 3) Atomically appending/prepending onto a value (http://code.google.com/p/memcached/wiki/FAQ#Storing_lists_of_data) #1 and #2 both require some form of spinning with random exponential back-off and #3 would require some form of locking after some point anyway to reformat the list as it nears the cache line limit of 1MB. Edit: I was hesitant on #1 and #2 was because I was unclear how one could scale to infinity without the average access time increasing to infinity. I realized that if too much contention occurs, one could start partitioning out the list based on value into N buckets where N increases based on some average access time.
-
Answer:
If memcahed is not a requirement you can take a look at Redis, it has already list and other data structures. http://redis.io/topics/data-types
Burak Dede at Quora Visit the source
Related Q & A:
- What's the best way to start a small clothing line business?Best solution by Yahoo! Answers
- What's the best way to get a job in a restaurant?Best solution by Yahoo! Answers
- What's the best way to make a good impression at a job interview?Best solution by Yahoo! Answers
- What's the best way to connect a home theater system?Best solution by Yahoo! Answers
- What's the best way to become a lawyer?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.