You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Aditya Narayan <ad...@gmail.com> on 2011/07/10 17:04:04 UTC

Storing counters in the standard column families along with non-counter columns ?

Is it now possible to store counters in the standard column families along
with non counter type columns ? How to achieve this ?

Re: Storing counters in the standard column families along with non-counter columns ?

Posted by Aditya Narayan <ad...@gmail.com>.
Thanks Aaron & Chris, I appreciate your help.

With dedicated CF for counters, in addition to the issue pointed by Chris,
the major drawback I see is that I cant read *in a single query* the
counters with the regular columns row which is widely required by my
application.
My use case is like storing & reading the 'views count' of a post along with
other post details(like post content,postedBy etc) in my application. I
wanted to store the views count(*counter column*) along with the details of
the post.



On Thu, Jul 14, 2011 at 10:20 PM, Chris Burroughs <chris.burroughs@gmail.com
> wrote:

> On 07/13/2011 03:57 PM, Aaron Morton wrote:
> > You can always use a dedicated CF for the counters, and use the same row
> key.
>
> Of course one could do this.  The problem is you are now spending ~2x
> disk space on row keys, and app specific client code just became more
> complicated.
>

Re: Storing counters in the standard column families along with non-counter columns ?

Posted by Chris Burroughs <ch...@gmail.com>.
On 07/13/2011 03:57 PM, Aaron Morton wrote:
> You can always use a dedicated CF for the counters, and use the same row key.

Of course one could do this.  The problem is you are now spending ~2x
disk space on row keys, and app specific client code just became more
complicated.

Re: Storing counters in the standard column families along with non-counter columns ?

Posted by Aaron Morton <aa...@thelastpickle.com>.
If you can provide some more details on the use case we may be able to provide some data model help.

You can always use a dedicated CF for the counters, and use the same row key.

Cheers


-----------------
Aaron Morton
Freelance Cassandra Developer
@aaronmorton
http://www.thelastpickle.com

On 12/07/2011, at 6:36 AM, Aditya Narayan <ad...@gmail.com> wrote:

> Oops that's really very much disheartening and it could seriously impact our plans for going live in near future. Without this facility I guess counters currently have very little usefulness.
> 
> On Mon, Jul 11, 2011 at 8:16 PM, Chris Burroughs <ch...@gmail.com> wrote:
> On 07/10/2011 01:09 PM, Aditya Narayan wrote:
> > Is there any target version in near future for which this has been promised
> > ?
> 
> The ticket is problematic in that it would -- unless someone has a
> clever new idea -- require breaking thrift compatibility to add it to
> the api.  Since is unfortunate since it would be so useful.
> 
> If it's in the 0.8.x series it will only be through CQL.
> 

Re: Storing counters in the standard column families along with non-counter columns ?

Posted by Aditya Narayan <ad...@gmail.com>.
Oops that's really very much disheartening and it could seriously impact our
plans for going live in near future. Without this facility I guess counters
currently have very little usefulness.

On Mon, Jul 11, 2011 at 8:16 PM, Chris Burroughs
<ch...@gmail.com>wrote:

> On 07/10/2011 01:09 PM, Aditya Narayan wrote:
> > Is there any target version in near future for which this has been
> promised
> > ?
>
> The ticket is problematic in that it would -- unless someone has a
> clever new idea -- require breaking thrift compatibility to add it to
> the api.  Since is unfortunate since it would be so useful.
>
> If it's in the 0.8.x series it will only be through CQL.
>

Re: Storing counters in the standard column families along with non-counter columns ?

Posted by Chris Burroughs <ch...@gmail.com>.
On 07/10/2011 01:09 PM, Aditya Narayan wrote:
> Is there any target version in near future for which this has been promised
> ?

The ticket is problematic in that it would -- unless someone has a
clever new idea -- require breaking thrift compatibility to add it to
the api.  Since is unfortunate since it would be so useful.

If it's in the 0.8.x series it will only be through CQL.

Re: Storing counters in the standard column families along with non-counter columns ?

Posted by Aditya Narayan <ad...@gmail.com>.
Cool. I am looking forward to the addition of this very much required
facility to Cassandra.


On Sun, Jul 10, 2011 at 11:01 PM, samal <sa...@wakya.in> wrote:

> Yes. may be 0.8.2
>
> current version need specific validation class CounterColumn for CCF, that
> only count [+,-,do not replace] stuff, where as normal CF simply just add or
> replace.
>
>
> On Sun, Jul 10, 2011 at 10:39 PM, Aditya Narayan <ad...@gmail.com> wrote:
>
>> Thanks for info.
>>
>> Is there any target version in near future for which this has been
>> promised ?
>>
>>
>> On Sun, Jul 10, 2011 at 9:12 PM, Sasha Dolgy <sd...@gmail.com> wrote:
>>
>>> No, it's not possible.
>>>
>>> To achieve it, there are two options ... contribute to the issue or
>>> wait for it to be resolved ...
>>>
>>> https://issues.apache.org/jira/browse/CASSANDRA-2614
>>>
>>> -sd
>>>
>>> On Sun, Jul 10, 2011 at 5:04 PM, Aditya Narayan <ad...@gmail.com>
>>> wrote:
>>> > Is it now possible to store counters in the standard column families
>>> along
>>> > with non counter type columns ? How to achieve this ?
>>>
>>
>>
>

Re: Storing counters in the standard column families along with non-counter columns ?

Posted by samal <sa...@wakya.in>.
Yes. may be 0.8.2

current version need specific validation class CounterColumn for CCF, that
only count [+,-,do not replace] stuff, where as normal CF simply just add or
replace.


On Sun, Jul 10, 2011 at 10:39 PM, Aditya Narayan <ad...@gmail.com> wrote:

> Thanks for info.
>
> Is there any target version in near future for which this has been promised
> ?
>
>
> On Sun, Jul 10, 2011 at 9:12 PM, Sasha Dolgy <sd...@gmail.com> wrote:
>
>> No, it's not possible.
>>
>> To achieve it, there are two options ... contribute to the issue or
>> wait for it to be resolved ...
>>
>> https://issues.apache.org/jira/browse/CASSANDRA-2614
>>
>> -sd
>>
>> On Sun, Jul 10, 2011 at 5:04 PM, Aditya Narayan <ad...@gmail.com> wrote:
>> > Is it now possible to store counters in the standard column families
>> along
>> > with non counter type columns ? How to achieve this ?
>>
>
>

Re: Storing counters in the standard column families along with non-counter columns ?

Posted by Aditya Narayan <ad...@gmail.com>.
Thanks for info.

Is there any target version in near future for which this has been promised
?

On Sun, Jul 10, 2011 at 9:12 PM, Sasha Dolgy <sd...@gmail.com> wrote:

> No, it's not possible.
>
> To achieve it, there are two options ... contribute to the issue or
> wait for it to be resolved ...
>
> https://issues.apache.org/jira/browse/CASSANDRA-2614
>
> -sd
>
> On Sun, Jul 10, 2011 at 5:04 PM, Aditya Narayan <ad...@gmail.com> wrote:
> > Is it now possible to store counters in the standard column families
> along
> > with non counter type columns ? How to achieve this ?
>

Re: Storing counters in the standard column families along with non-counter columns ?

Posted by Sasha Dolgy <sd...@gmail.com>.
No, it's not possible.

To achieve it, there are two options ... contribute to the issue or
wait for it to be resolved ...

https://issues.apache.org/jira/browse/CASSANDRA-2614

-sd

On Sun, Jul 10, 2011 at 5:04 PM, Aditya Narayan <ad...@gmail.com> wrote:
> Is it now possible to store counters in the standard column families along
> with non counter type columns ? How to achieve this ?