I have tried different approaches but I can't find a solution to my problem: My data is table-like, meaning I have one data point (float) for each combination of inputs from a set of Strings:
(a mapping of S × S → ℝ )
I want to model the schema so that I can do the following lookups:
- all pairs of strings with a value in a certain range
- for a given input String, all Strings for which the mapped value is in certain range
- for a given combination of input Strings the mapped value
Since the mapping is symmetrical (m(x,y) == m(y,x)
), it would be great if I only had to store the
n*(n+1) / 2
unique values instead of the n^2
total mappings.
What I have tried so far:
- S1+" "+S2 as row key and the value as column name
- S1 as row key and a Composite key of [S2:value] as column name
- S1 as row key, S2 as column name, value as column value.
but unfortunately, all these approaches don't let me do all the queries I need. Is this even possible in Cassandra?