Cha*_*ity 7 cql cassandra cql3 cassandra-2.0
我试图了解Cassandra数据模型的基本原理.我正在使用CQL.据我所知,必须先定义架构,然后才能插入新列.如果有人需要添加任何列,可以使用ALTER TABLE并将INSERT值插入该新列.
但是在cassandra权威指南中写道,Cassandra的架构较少.
In Cassandra, you don’t define the columns up front; you just define the column families you want in the keyspace, and then you can start writing data without defining the columns anywhere. That’s because in Cassandra, all of a column’s names are supplied by the client.
我感到困惑,没有找到任何预期的答案.有人可以向我解释或告诉我,如果我错过了什么吗?
提前致谢.
两个不同的API与Cassandra交互以编写数据.首先是thrift API,它总是允许动态创建列,但也支持为列添加元数据.接下来是更新的基于CQL的API.创建CQL是为了提供另一个抽象层,使其更适合与Cassandra一起使用.使用CQL,您需要为列名和数据类型预先定义模式.但是,这并不意味着无法使用CQL使用动态列.
请参阅此处了解差异:http: //www.datastax.com/dev/blog/thrift-to-cql3
| 归档时间: |
|
| 查看次数: |
1722 次 |
| 最近记录: |