Re: N to N relationships

2010-12-13 Thread Sébastien Druon
Thanks a lot for the support! On Thu, 2010-12-09 at 19:50 -0600, Nick Bailey wrote: > I would also recommend two column families. Storing the key as NxN > would require you to hit multiple machines to query for an entire row > or column with RandomPartitioner. Even with OPP you would need to pick

Re: N to N relationships

2010-12-12 Thread Aaron Morton
RE: storing every value twice. Cassandra is not a RDBMS, the goal is not to achieve fifth normal form. The goal is to design your storage schema to support the queries you wish to run. Storage is cheap. And it's really not a pain to store the values more than once. Use the batch_mutate() funct

Re: N to N relationships

2010-12-12 Thread Edward Capriolo
On Sun, Dec 12, 2010 at 3:20 AM, David Boxenhorn wrote: > You want to store every value twice? That would be a pain to maintain, and > possibly lead to inconsistent data. > > On Fri, Dec 10, 2010 at 3:50 AM, Nick Bailey wrote: >> >> I would also recommend two column families. Storing the key as N

Re: N to N relationships

2010-12-12 Thread David Boxenhorn
You want to store every value twice? That would be a pain to maintain, and possibly lead to inconsistent data. On Fri, Dec 10, 2010 at 3:50 AM, Nick Bailey wrote: > I would also recommend two column families. Storing the key as NxN would > require you to hit multiple machines to query for an ent

Re: N to N relationships

2010-12-09 Thread Nick Bailey
I would also recommend two column families. Storing the key as NxN would require you to hit multiple machines to query for an entire row or column with RandomPartitioner. Even with OPP you would need to pick row or columns to order by and the other would require hitting multiple machines. Two colu

Re: N to N relationships

2010-12-09 Thread Aaron Morton
Am assuming you have one matrix and you know the dimensions. Also as you say the most important queries are to get an entire column or an entire row.I would consider using a standard CF for the Columns and one for the Rows.  The key for each would be the col / row number, each cassandra column name

Re: N to N relationships

2010-12-09 Thread Sébastien Druon
I mean if I have secondary indexes. Apparently they are calculated in the background... On 9 December 2010 18:33, David Boxenhorn wrote: > What do you mean by indexing? > > On Thu, Dec 9, 2010 at 7:30 PM, Sébastien Druon wrote: > >> Thanks a lot for the answer >> >> What about the indexing when

Re: N to N relationships

2010-12-09 Thread David Boxenhorn
What do you mean by indexing? On Thu, Dec 9, 2010 at 7:30 PM, Sébastien Druon wrote: > Thanks a lot for the answer > > What about the indexing when adding a new element? Is it incremental? > > Thanks again > > > On 9 December 2010 14:38, David Boxenhorn wrote: > >> How about a regular CF where

Re: N to N relationships

2010-12-09 Thread Sébastien Druon
Thanks a lot for the answer What about the indexing when adding a new element? Is it incremental? Thanks again On 9 December 2010 14:38, David Boxenhorn wrote: > How about a regular CF where keys are n...@n ? > > Then, getting a matrix row would be the same cost as getting a matrix > column (N

Re: N to N relationships

2010-12-09 Thread David Boxenhorn
How about a regular CF where keys are n...@n ? Then, getting a matrix row would be the same cost as getting a matrix column (N gets), and it would be very easy to add element N+1. On Thu, Dec 9, 2010 at 1:48 PM, Sébastien Druon wrote: > Hello, > > For a specific case, we are thinking about rep

N to N relationships

2010-12-09 Thread Sébastien Druon
Hello, For a specific case, we are thinking about representing a N to N relationship with a NxN Matrix in Cassandra. The relations will be only between a subset of elements, so the Matrix will mostly contain empty elements. We have a set of questions concerning this: - what is the best way to rep