最近有很多关于卡桑德拉的话题。
Twitter, Digg, Facebook等都在使用它。
什么时候有意义:
使用卡桑德拉, 不用卡桑德拉,还有 使用RDMS而不是Cassandra。
最近有很多关于卡桑德拉的话题。
Twitter, Digg, Facebook等都在使用它。
什么时候有意义:
使用卡桑德拉, 不用卡桑德拉,还有 使用RDMS而不是Cassandra。
当前回答
除了这里的其他答案之外,沉重的单个查询与无数的轻查询负载是另一个需要考虑的问题。在nosql风格的DB中自动优化单个查询本身就比较困难。我使用过MongoDB,在尝试计算复杂查询时遇到了性能问题。我没有使用Cassandra,但我预计它会有同样的问题。
另一方面,如果您的负载预期是许多小型查询的负载,并且您希望能够轻松地向外扩展,那么您可以利用大多数NoSql数据库提供的最终一致性。注意,最终一致性实际上不是非关系数据模型的特性,但是在基于nosql的系统中实现和设置一致性要容易得多。
For a single, very heavy query, any modern RDBMS engine can do a decent job parallelizing parts of the query and take advantage of as much CPU and memory you throw at it (on a single machine). NoSql databases don't have enough information about the structure of the data to be able to make assumptions that will allow truly intelligent parallelization of a big query. They do allow you to easily scale out more servers (or cores) but once the query hits a complexity level you are basically forced to split it apart manually to parts that the NoSql engine knows how to deal with intelligently.
根据我使用MongoDB的经验,由于查询的复杂性,MongoDB最终无法对其进行优化,也无法在多个数据上运行部分查询。Mongo可以并行多个查询,但不太擅长优化单个查询。
其他回答
Cassandra是个不错的选择,如果:
您不需要DB中的ACID属性。 DB上会有大量的写操作。 需要与大数据、Hadoop、Hive和Spark集成。 需要实时数据分析和生成报告。 有一个强大的容错机制的要求。 有一个齐次系统的要求。 调优需要大量的自定义。
你应该问自己以下问题:
(Volume, Velocity) Will you be writing and reading TONS of information , so much information that no one computer could handle the writes. (Global) Will you need this writing and reading capability around the world so that the writes in one part of the world are accessible in another part of the world? (Reliability) Do you need this database to be up and running all the time and never go down regardless of which Cloud, which country, whether it's VM , Container, or Bare metal? (Scale-ability) Do you need this database to be able to continue to grow easily and scale linearly (Consistency) Do you need TUNABLE consistency where some writes can happen asynchronously where as others need to be certified? (Skill) Are you willing to do what it takes to learn this technology and the data modeling that goes with creating a globally distributed database that can be fast for everyone, everywhere?
如果在这些问题中,你认为“可能”或“不”,你应该用别的词。如果你对所有问题的答案都是“当然”,那么你应该用卡桑德拉。
当你可以在一个盒子上做所有事情时,使用RDBMS。它可能比大多数方法都简单,任何人都可以使用它。
Cassandra是一个特定问题的答案:当您有太多数据,以至于无法在一台服务器上存储时,您该怎么办?如何将所有数据存储在多个服务器上,同时不破坏银行账户,不让开发人员抓狂?Facebook每天都会收到4tb的压缩数据。这个数字很可能在一年内增长两倍以上。
如果您没有这么多数据,或者您有数百万美元来支付企业Oracle/DB2集群安装费用,以及安装和维护它所需的专家,那么您可以使用SQL数据库。
然而,Facebook不再使用cassandra,现在几乎只使用MySQL,在应用程序堆栈中移动分区,以获得更快的性能和更好的控制。
在评估分布式数据系统时,您必须考虑CAP定理——您可以选择以下两个:一致性、可用性和分区容差。
Cassandra是一个可用的、支持最终一致性的分区容忍系统。要了解更多信息,请参阅我写的这篇博客文章:NoSQL系统的可视化指南。
根据DataStax,当需要Cassandra时,它并不是最好的用例
1-高端硬件设备。 2- ACID兼容,无回滚(银行交易)