cassandra 数据模型简介

1.Column  && Standard Column Family

RowKey: app1
=> (column=appName, value=app1, timestamp=1397200197351000)
=> (column=avgTime, value=8.0, timestamp=1397200197351001)
-------------------
RowKey: app-warning
=> (column=appName, value=app, timestamp=1397202476370000)
=> (column=level, value=warning, timestamp=1397202476371000)
=> (column=sum, value=5, timestamp=1397202476373000)
-------------------
RowKey: app2
=> (column=appName, value=app2, timestamp=1397200198380000)
=> (column=avgTime, value=9.0, timestamp=1397200198381000)
-------------------
RowKey: app-error
=> (column=appName, value=app, timestamp=1397202477375000)
=> (column=level, value=error, timestamp=1397202477376000)
=> (column=sum, value=5, timestamp=1397202477377000)
上面的就是一个 Standard Column Family 


(column=appName, value=app, timestamp=1397202477375000)
这些就是 Column 


可见:Standard Column Family 是由 Key 值 组合的一些Column 组成的



2. Super Column && Super Column Family

RowKey: 2012-10-1-10
=> (super_column=1,
     (column=appName, value=app2, timestamp=1393920048631000)
     (column=averResTime, value=2, timestamp=1393920048637000))
=> (super_column=2,
     (column=appName, value=app2, timestamp=1393921235195000)
     (column=averResTime, value=2, timestamp=1393921235201000))
-------------------
RowKey: 2013-10-28-14
=> (super_column=api.cf0.local,
     (column=appName, value=api.cf0.local, timestamp=1394432030019000)
     (column=averResTime, value=0.009666666666666665, timestamp=1394432030019001))
-------------------
RowKey: 2013-10-28-15
=> (super_column=announcemen.cf0.local,
     (column=appName, value=announcemen.cf0.local, timestamp=1394432030118000)
     (column=averResTime, value=0.007, timestamp=1394432030118001))
=> (super_column=announcement.cf0.local,
     (column=appName, value=announcement.cf0.local, timestamp=1394432030114000)
     (column=averResTime, value=0.0086, timestamp=1394432030114001))

这个就是一个Super Column Family 

加黑的就是一个简单的Super Column


可见:一个Super Column Family 是 有一些RowKey 代表的 Column family 组成的 (自己总结,错误自负)


3 Keyspace 

一个keyspace 可以包含多个Column Family 


4 schema 数据库中的概念  --查了下定义 

A schema is a collection of database objects (used by a user.).

schema objects are the logical structures that directly refer to the database’s data.

A user is a name defined in the database that can connect to and access objects.

schemas and users help database administrators manage database security.


应该是类似oracle ,这个还有待考证~



 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值