What's the difference between creating a table and creating a columnfamily in Cassandra?

前端 未结 5 1460
情书的邮戳
情书的邮戳 2021-02-03 20:59

I need details from both performance and query aspects, I learnt from some site that only a key can be given when using a columnfamily, if so what would you suggest for

5条回答
  •  逝去的感伤
    2021-02-03 21:28

    For Cassandra 3+ and cqlsh 5.0.1

    To verify, enter into a cqlsh prompt within keyspace (ksp):

    CREATE COLUMNFAMILY myTable (
         ...  id text,
         ...  name int
    );
    
    

    And type 'desc myTable'.
    You'll see:

    CREATE TABLE ksp.myTable (
          ...  id text,
          ...  name int
    );
    
    

    They are synonyms, and Cassandra uses table by default.

提交回复
热议问题