On Fri, Jan 13, 2017 at 5:14 PM, Mike Torra <mto...@demandware.com> wrote:
> We currently use redis to store sorted sets that we increment many, many > times more than we read. For example, only about 5% of these sets are ever > read. We are getting to the point where redis is becoming difficult to > scale (currently at >20 nodes). > > We've started using cassandra for other things, and now we are > experimenting to see if having a similar 'sorted set' data structure is > feasible in cassandra. My approach so far is: > > 1. Use a counter CF to store the values I want to sort by > 2. Periodically read in all key/values in the counter CF and sort in > the client application (~every five minutes or so) > 3. Write back to a different CF with the ordered keys I care about > > Does this seem crazy? Is there a simpler way to do this in cassandra? > Have you considered using only the keys in Cassandra's map type? I proposed an implementation that I wanted to experiment with adding to a set: https://issues.apache.org/jira/browse/CASSANDRA-6870 . Even though redis and it's feature set is wildly popular there is not a great consensus that Cassandra should do those things as manipulations of a single column.