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 <sdr...@spotuse.com> wrote: > 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 represent this matrix? what would have the best > performance in reading? in writing? > . a super column family with n column families, with n columns each > . a column family with n columns and n lines > > In the second case, we would need to extract 2 kinds of information: > - all the relations for a line: this should be no specific problem; > - all the relations for a column: in that case we would need an index for > the columns, right? and then get all the lines where the value of the column > in question is not null... is it the correct way to do? > When using indexes, say we want to add another element N+1. What impact in > terms of time would it have on the indexation job? > > Thanks a lot for the answers, > > Best regards, > > Sébastien Druon >