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