Is there anything like memcached, but for sorted lists?

Posted by depesz on Stack Overflow See other posts from Stack Overflow or by depesz
Published on 2009-06-22T13:03:10Z Indexed on 2010/04/24 21:33 UTC
Read the original article Hit count: 229

Filed under:
|
|
|

I have a situation where I could really benefit from having system like memcached, but with the ability to store (per each key) sorted list of elements, and modifying the list by addition of values.

For example:

something.add_to_sorted_list( 'topics_list_sorted_by_title', 1234, 'some_title')
something.add_to_sorted_list( 'topics_list_sorted_by_title', 5436, 'zzz')
something.add_to_sorted_list( 'topics_list_sorted_by_title', 5623, 'aaa')

Which I then could use like this:

something.get_list_size( 'topics_list_sorted_by_title' )
// returns 3
something.get_list_elements( 'topics_list_sorted_by_title', 1, 10 )
// returns: 5623, 1234, 5436

Required system would allow me to easily get items count in every array, and fetch any number of values from the array, with the assumption that the values are sorted using attached value.

I hope that the description is clear. And the question is relatively simple: is there any such system?

© Stack Overflow or respective owner

Related posts about cache

Related posts about memcached