HBASE cassandra 本質上其實都是KEY -VALUE(非關係型) 的行式存儲數據庫 而列式數據庫可以是關係型的。


筆者曾經對 hbase cassandra, bigtable等說成是 列式存儲也是疑惑過很久。


1. 列式存儲數據庫(Column-oriented database)一般也叫做列式數據庫。 你可以看下具體的定義,而且列式存儲大部分是關係型數據庫,支持SQL。有名的例子有:Sybase IQ, C-Store, Vertica, VectorWise, MonetDB, ParAccel, and Infobright

http://en.wikipedia.org/wiki/Column-oriented_DBMS


2.  懶的寫例子,貼一段國外人的例子。一看就知道是 行式數據庫(row-oriented)。 如果想進一步瞭解,或者英語不好看看以下幾鏈接,就知道 column family其實就是相當於表的概念,每個column就是一個記錄。

HBase will do two things for you:
1. All keys that have the same row key are stored in the same region
2. All keys are sorted


(The column family is special in the each column family has it's one store file, but the logical sort order still holds).

Think of it this way.
Say you have two column families and two regions (A and B). You find the following ordering:
Storefile(s) for column family 1 in Region A:
(row1, column family1, column1, ts)->value
(row1, column family1, column2, ts)->value
(row2, column family1, column1, ts)->value
(row2, column family1, column2, ts)->value

Storefile(s) for column family 1 in Region B:
(row3, column family1, column1, ts)->value
(row3, column family1, column2, ts)->value

Storefile(s) for column family 2: in Region A:
(row1, column family2, column1, ts)->value
(row1, column family2, column2, ts)->value
(row2, column family2, column1, ts)->value
(row2, column family2, column2, ts)->value

Storefile(s) for column family 2 in Region B:
(row3, column family2, column1, ts)->value
(row3, column family2, column2, ts)->value

So region A has rows row1 and row2, region B has row3.
A region is shard of a table based on the row key and just

#1 above means that HBase will never place key value for "row1" in different regions.
#2 means you very efficiently locate specific keys, as they are always stored sorted.



http://www.ibm.com/developerworks/cn/opensource/os-cn-cassandra/

http://blog.csdn.net/imzkz/article/details/5647811

http://database.51cto.com/art/201005/202153.htm


3. 其他人的認同文章。

http://blog.csdn.net/historyasamirror/article/details/6214466


4. 國外拒絕承認 他們是 column-oriented 的大討論

http://dbmsmusings.blogspot.com/2010/03/distinguishing-two-major-types-of_29.html

https://groups.google.com/forum/#!topic/nosql-databases/nTHhOMD5HOw


5. 國內很多人誤認爲是 column-oriented

http://www.docin.com/p-595677296.html



發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章