Re: RE Ordering counters in Cassandra

2012-05-23 Thread aaron morton
> Just out of curiosity, is there any underlying architectural reason why it's > not possible to order a row based on its counters values? or is it something > that might be in the roadmap in the future? it wouldn't work well with the consistency level. Also, sorting a list of values at the same

Re: RE Ordering counters in Cassandra

2012-05-22 Thread samal
Secondary index is not supported for counters plus you must know column name to support secondary index on regular column. On 22-May-2012 5:34 PM, "Filippo Diotalevi" wrote: > Thanks for all the answers, they definitely helped. > > Just out of curiosity, is there any underlying architectural rea

Re: RE Ordering counters in Cassandra

2012-05-22 Thread Filippo Diotalevi
Thanks for all the answers, they definitely helped. Just out of curiosity, is there any underlying architectural reason why it's not possible to order a row based on its counters values? or is it something that might be in the roadmap in the future? -- Filippo Diotalevi On Tuesday, 22 M

Re: Ordering counters in Cassandra

2012-05-22 Thread aaron morton
> What's the best approach to perform this task? get the columns in slices of a 100 or so and order on the client. Then write a new row that is a pivot so the column name is the aggregate count and the column value is the old column name. To slice the row, make the first call with no start_col

Re: RE Ordering counters in Cassandra

2012-05-22 Thread Romain HARDOUIN
I mean iterate over each column -- more precisly: *bunches of columns* using slices -- and write new columns in the inversed index. Tamar's data model is made for real time analysis. It's maybe overdesigned for a daily ranking. I agree with Samal, you should split your data across the space of to

Re: RE Ordering counters in Cassandra

2012-05-22 Thread samal
In some cases Cassandra is really good and in some cases it is not. The way I see your approach is your are recording all of your events in single "key" is it? Not recommended. It can go really big also if your have cluster of servers, "It will hit only one server all the time make it overwhelm, a

Re: RE Ordering counters in Cassandra

2012-05-21 Thread Tamar Fraenkel
Indeed I took the not delete approach. If time bucket rows are not that big, this is a good temporary solution. I just finished implementation and testing now on a small staging environment. So far so good. Tamar Sent from my iPod On May 21, 2012, at 9:11 PM, Filippo Diotalevi wrote: > Hi Tam

Re: RE Ordering counters in Cassandra

2012-05-21 Thread Filippo Diotalevi
Hi Tamar, the solution you propose is indeed a "temporary solution", but it might be the best one.Which approach did you follow?I'm a bit concerned about the deletion approach, since in case of concurrent writes on the same counter you might "lo

Re: RE Ordering counters in Cassandra

2012-05-21 Thread Tamar Fraenkel
I also had a similar problem. I have a temporary solution, which is not best, but may be of help. I have the coutner cf to count events, but apart from that I hold leaders CF: leaders = { // key is time bucket // values are composites(rank, event) ordered by // descending order of the rank

Re: RE Ordering counters in Cassandra

2012-05-21 Thread Filippo Diotalevi
Hi Romain, thanks for your suggestion. When you say " build every day a ranking in a dedicated CF by iterating over events:" do you mean - load all the columns for the specified row key - iterate over each column, and write a new column in the inversed index ? That's my current approach, but s

RE Ordering counters in Cassandra

2012-05-21 Thread Romain HARDOUIN
If I understand you've got a data model which looks like this: CF Events: "row1": { "event1": 1050, "event2": 1200, "event3": 830, ... } You can't query on column values but you can build every day a ranking in a dedicated CF by iterating over events: create column family Ranking with c