Modeling many-to-many relations in Cassandra 2 with CQL3

后端 未结 2 1969
我在风中等你
我在风中等你 2021-02-09 12:49

What is the canonical way to model many-to-many relations with CQL3 ? Let\'s say I have to tables

CREATE TABLE actor (
    id text PRIMARY KEY,
    given text,
          


        
2条回答
  •  隐瞒了意图╮
    2021-02-09 13:31

    The proper way to do this in Cassandra is denormalizing the data into 2 tables. You shouldn't worry about having to write twice, once on each table, as Cassandra is designed to handle writes very fast to support such model.

    Take a look at this data modelling tutorials that will help understanding these things:

    Data modelling tutorials

    Also I see you mentioned sets as well. Just as a side note and although it is not an answer to your questions, you might want to be aware of some new features like: http://www.datastax.com/dev/blog/cql-in-2-1

提交回复
热议问题