understand the data model of Cassandra
来源:互联网 发布:免费书旗软件下载 编辑:程序博客网 时间:2024/05/14 13:57
// this note is helpful to understand the data model of Cassandra
// ref: http://arin.me/blog/wtf-is-a-supercolumn-cassandra-data-model
set up a simple blog system, the requirements are as follow:
1, has many users
2, a blog has the title, body, timestamp
3, any user can comment a blog. a comment has the content, user, and timestamp
4, each blog can have many tags with no count limits
schma of Sql/RDMS
table : authors {
id primary_key,
name,
sex,
}
table: blogs {
id primary_key,
title,
body,
timestamp,
author_id foreign_key(authors.id)
}
table: comments {
id primary_key,
content,
timestamp,
author_id foreign_key(authors.id)
}
table: tags {
id primary_key
name
}
table: blog_tags {
blog_id,
tag_id
} // it's the relation !
sample query
select b.title from blogs b, tags t, blog_tags bt
where b.id = bt.blog_id and bt.tag_id = t.id and t.name = 'sql';
schma of Cassandra
actually, it's not suitable to use 'schma' here
authors: {
Tom: {
sex: male,
mail: tom@xxx.com
}
}
blogs: {
notes_for_nosql: {
body: blahblahblah,
timestamp: 123456
tags: nosql, dev
}
comments: {
notes_for_nosql: {
timeuuid_1: {
commenter: Lily,
content: good
pubdate: 12345
}
timeuuid_2: {
commenter: John,
content: good job,
pubdata: 123457
}
}
}
taggedposts: {
nosql: {
timeuuid_1: notes_for_nosql,
timeuuid_2: learn_cassandra
}
dev: {
timeuuid_3: notes_for_nosql
}
}
to be continued ...
- understand the data model of Cassandra
- Cassandra data model
- 解剖 Cassandra 【1】Data Model
- Understand the Impact of Change
- Inside The C++ Object Model ---- The Semantics of Data
- The Data Model
- the understand of SOA and Web Services
- Understand the probabilistic way of doing SLAM
- Basic Rules of Cassandra Data Modeling
- Ofbiz data model of product
- Ofbiz data model of party
- Ofbiz Data Model of Order
- inside the C++ object model chapter 3 the semantics of data
- Effective C++ 49. Understand the behavior of the new-handler
- Why does Quora use MySQL as the data store instead of NoSQLs such as Cassandra, MongoDB, CouchDB etc?
- Why does Quora use MySQL as the data store instead of NoSQLs such as Cassandra, MongoDB, or CouchDB?
- More Effctive C++ Item19 (Understand the origin of temporary objects)
- Effective C# 10:Understand the Pitfalls of GetHashCode()
- 软件架构师定义
- TC35学习1--------深入浅出VC++串口编程之短信应用开发
- Accessing Local Database SQLite with AIR API
- Android[中级教程]第六章 XML解析之SAX解析器
- URL自动填充参数导致的OAuth签名验证失败
- understand the data model of Cassandra
- 解决在WIN7(64位)上Mex无法编译的问题
- HDOJ1864背包问题.
- UVa Problem 10039 Railroads (铁路)
- 软件架构师成长之路
- IIS不同版本的WCF 的寄宿环境
- 关于内核中此宏list_for_each_entry的说明
- JavaScript中常见的几种创建对象的方式:基于对象扩充属性和方法、基于工厂方式创建对象、基于构造函数和基于原型
- JSP中文乱码详解