HBase 和 Cassandra的一些比较
- 如何选择
知乎回答
阿里云-
HBase强一致,依赖hadoop生态,hdfs的NN的单点故障,支持scan的性能更好,随机读就比较坑。阿里云文章提到了HBASE的A比较差,因为hdfs的NN单点。但是实际上hdfs的HA里有standby的办法,应该不是很大的问题。
-
Cassandra最终一致(可调一致性),更注重A,给予quorum的,没有hdfs的单点故障,随机读写好,但是scan的性能较弱。一致性问题是比较大的坑(个人深受其害)。
-
- 两个数据库都是列簇数据库,而不是列数据库。
<DDIA> Cassandra and HBase have a concept of column families, which they inherited from Bigtable. However, it is very misleading to call them column-oriented: within each column family, they store all columns from a row together, along with a row key, and they do not use column compression. Thus, the Bigtable model is still mostly row-oriented.
C*
-
Cassandra 的架构, 有点意思:架构,读写流程图
-
C* 的“表”设计 primary key(partiontion key + column clustering)
先看这个
再看这个,稍微进阶一些
高阶1
高阶2
Hbase
- 先看下表的设计。
1.一些基本和实战(最后的那个例子我觉得错了,不太好)
1.1说了些宽表高表的概念
2.这个表的设计更好,正反向都能扫
3.rowkey的扫描可以字符串匹配的,所以两张表更合理
4.一些设计的原则
5.一点实战
-
再来看Hbase的架构: 介绍来自mapR. Hmaster, regionServer都是利用ZK来搞的。
网友评论