I have a problem with representing a complex data structure in cassandra. Sample JSON data:
{ "A": { "A_ID" : "1111" "field1": "value1", "field2": "value2", "field3": [ { "id": "id1", "name": "name1", "segment": [ { "segment_id": "segment_id_1", "segment_name": "segment_name_1", "segment_value": "segment_value_1" }, { "segment_id": "segment_id_2", "segment_name": "segment_name_2", "segment_value": "segment_value_2" }, ... ] }, { "id": "id2", "name": "name2", "segment": [ { "segment_id": "segment_id_3", "segment_name": "segment_name_3", "segment_value": "segment_value_3" }, { "segment_id": "segment_id_4", "segment_name": "segment_name_4", "segment_value": "segment_value_4" }, ... ] }, ... ] } }
Only one query will be used: Find by A_ID.
I think that this data should be stored in one TABLE (Column Family) and without serialization / deserialization operations for greater efficiency. How to do this if CQL does not support nested maps and lists?
source share