You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Sasha Dolgy <sa...@gmail.com> on 2011/01/28 13:15:27 UTC

Secondary Index information

Hi there,

Where can I find information regarding secondary indexes?  Spent the
past 2 days looking for some good details.

http://wiki.apache.org/cassandra/SecondaryIndexes doesn't yet exist,
althought it's referenced from
http://wiki.apache.org/cassandra/StorageConfiguration

Trying to understand if this feature will afford me a larger benefit
when compared to an inverted index solution.

Thanks in advance,
-sd

--
Sasha Dolgy
@sdolgy
sasha.dolgy@gmail.com

Re: Secondary Index information

Posted by "B. Todd Burruss" <bb...@real.com>.
batch_mutate doesn't guarantee consistency.  each mutation in the batch 
is guaranteed to be consistent based on your CL, but if it returns an 
error it means that it couldn't complete all mutations ... but the 
converse isn't true.  it may have successfully completed some 
mutations.  if you get an error you should retry the entire batch as 
long as the operation is idempotent.

http://wiki.apache.org/cassandra/FAQ#batch_mutate_atomic


On 01/28/2011 07:12 AM, Sasha Dolgy wrote:
> Hi Victor,
>
> In my research and playing around with nosql, specifically cassandra,
> I see the true benefit in defining search requirements and then
> creating CF's and the hierarchy based on this.  So for me, I see quite
> a bit of simplicity in defining alternate CF's to allow me to
> efficiently find a specific row.  For example, I have a CF for users
> with uid as the key and some random columns like name, birthday, etc,
> etc. etc.  I have another CF for user emails where email is the key
> and the user uid the column.  I am structuring my application to
> target specific rows based on the keys ... cheating on search.
> Suppose we have different definitions of simplicity ; )
>
> With regards to your second comment, consistency, I am using Hector
> and using the Batch_Mutation to ensure my writes are consistent
>
> Of course, maybe I'm way off here and have missed the plot entirely.
>
> Just trying to understand if secondary indexes degrade the the core
> benefits of cassandra
>
> On Fri, Jan 28, 2011 at 3:43 PM, Victor Kabdebon
> <vi...@gmail.com>  wrote:
>> Dear Sasha,
>>
>> I am currently thinking about using secondary index in the future. I have
>> seen two pros :
>> _Simplicity, it is "more simple" to query based on a second index than going
>> for a first column then a second.
>> _ "Consistency" : depending on where you store your inverted index, it may
>> be unavailable to query because of a node down, or an error allows you to
>> insert in the first column but then you crash and cannot insert into the
>> inverted your inverse information. Because of that you cannot query and you
>> have to periodically check the consistency of the data in the double column.
>> That's what I am doing right now for my applications and making it simpler
>> and more consistent would be great.
>>
>> Remember : I don't know the details of the implementation, I take this
>> principle as if it was perfectly working.
>> But I am interested in experiences.

Re: Secondary Index information

Posted by Sasha Dolgy <sd...@gmail.com>.
Hi Victor,

In my research and playing around with nosql, specifically cassandra,
I see the true benefit in defining search requirements and then
creating CF's and the hierarchy based on this.  So for me, I see quite
a bit of simplicity in defining alternate CF's to allow me to
efficiently find a specific row.  For example, I have a CF for users
with uid as the key and some random columns like name, birthday, etc,
etc. etc.  I have another CF for user emails where email is the key
and the user uid the column.  I am structuring my application to
target specific rows based on the keys ... cheating on search.
Suppose we have different definitions of simplicity ; )

With regards to your second comment, consistency, I am using Hector
and using the Batch_Mutation to ensure my writes are consistent

Of course, maybe I'm way off here and have missed the plot entirely.

Just trying to understand if secondary indexes degrade the the core
benefits of cassandra

On Fri, Jan 28, 2011 at 3:43 PM, Victor Kabdebon
<vi...@gmail.com> wrote:
> Dear Sasha,
>
> I am currently thinking about using secondary index in the future. I have
> seen two pros :
> _Simplicity, it is "more simple" to query based on a second index than going
> for a first column then a second.
> _ "Consistency" : depending on where you store your inverted index, it may
> be unavailable to query because of a node down, or an error allows you to
> insert in the first column but then you crash and cannot insert into the
> inverted your inverse information. Because of that you cannot query and you
> have to periodically check the consistency of the data in the double column.
> That's what I am doing right now for my applications and making it simpler
> and more consistent would be great.
>
> Remember : I don't know the details of the implementation, I take this
> principle as if it was perfectly working.
> But I am interested in experiences.

Re: Secondary Index information

Posted by Victor Kabdebon <vi...@gmail.com>.
Dear Sasha,

I am currently thinking about using secondary index in the future. I have
seen two pros :
_Simplicity, it is "more simple" to query based on a second index than going
for a first column then a second.
_ "Consistency" : depending on where you store your inverted index, it may
be unavailable to query because of a node down, or an error allows you to
insert in the first column but then you crash and cannot insert into the
inverted your inverse information. Because of that you cannot query and you
have to periodically check the consistency of the data in the double column.
That's what I am doing right now for my applications and making it simpler
and more consistent would be great.

Remember : I don't know the details of the implementation, I take this
principle as if it was perfectly working.
But I am interested in experiences.

Best regards,
Victor K.
http://www.voxnucleus.fr

2011/1/28 Sasha Dolgy <sd...@gmail.com>

> Thank you.  So, after reading, I'm still unsure if this feature will
> afford me a larger benefit when compared to an inverted index
> solution.
>
> Has anyone done a pros / cons ?
>
> -sd
>
>
> On Fri, Jan 28, 2011 at 3:22 PM, Jake Luciani <ja...@gmail.com> wrote:
> > http://www.datastax.com/blog/whats-new-cassandra-07-secondary-indexes
> >
> > On Fri, Jan 28, 2011 at 7:15 AM, Sasha Dolgy <sa...@gmail.com>
> wrote:
> >>
> >> Hi there,
> >>
> >> Where can I find information regarding secondary indexes?  Spent the
> >> past 2 days looking for some good details.
> >>
> >> http://wiki.apache.org/cassandra/SecondaryIndexes doesn't yet exist,
> >> althought it's referenced from
> >> http://wiki.apache.org/cassandra/StorageConfiguration
> >>
> >> Trying to understand if this feature will afford me a larger benefit
> >> when compared to an inverted index solution.
> >>
> >> Thanks in advance,
> >> -sd
> >>
> >> --
> >> Sasha Dolgy
> >> @sdolgy
> >> sasha.dolgy@gmail.com
>

Re: Secondary Index information

Posted by Sasha Dolgy <sd...@gmail.com>.
Thank you.  So, after reading, I'm still unsure if this feature will
afford me a larger benefit when compared to an inverted index
solution.

Has anyone done a pros / cons ?

-sd


On Fri, Jan 28, 2011 at 3:22 PM, Jake Luciani <ja...@gmail.com> wrote:
> http://www.datastax.com/blog/whats-new-cassandra-07-secondary-indexes
>
> On Fri, Jan 28, 2011 at 7:15 AM, Sasha Dolgy <sa...@gmail.com> wrote:
>>
>> Hi there,
>>
>> Where can I find information regarding secondary indexes?  Spent the
>> past 2 days looking for some good details.
>>
>> http://wiki.apache.org/cassandra/SecondaryIndexes doesn't yet exist,
>> althought it's referenced from
>> http://wiki.apache.org/cassandra/StorageConfiguration
>>
>> Trying to understand if this feature will afford me a larger benefit
>> when compared to an inverted index solution.
>>
>> Thanks in advance,
>> -sd
>>
>> --
>> Sasha Dolgy
>> @sdolgy
>> sasha.dolgy@gmail.com

Re: Secondary Index information

Posted by Jake Luciani <ja...@gmail.com>.
http://www.datastax.com/blog/whats-new-cassandra-07-secondary-indexes

On Fri, Jan 28, 2011 at 7:15 AM, Sasha Dolgy <sa...@gmail.com> wrote:

> Hi there,
>
> Where can I find information regarding secondary indexes?  Spent the
> past 2 days looking for some good details.
>
> http://wiki.apache.org/cassandra/SecondaryIndexes doesn't yet exist,
> althought it's referenced from
> http://wiki.apache.org/cassandra/StorageConfiguration
>
> Trying to understand if this feature will afford me a larger benefit
> when compared to an inverted index solution.
>
> Thanks in advance,
> -sd
>
> --
> Sasha Dolgy
> @sdolgy
> sasha.dolgy@gmail.com
>