最近有很多关于卡桑德拉的话题。
Twitter, Digg, Facebook等都在使用它。
什么时候有意义:
使用卡桑德拉, 不用卡桑德拉,还有 使用RDMS而不是Cassandra。
最近有很多关于卡桑德拉的话题。
Twitter, Digg, Facebook等都在使用它。
什么时候有意义:
使用卡桑德拉, 不用卡桑德拉,还有 使用RDMS而不是Cassandra。
当前回答
another situation that makes the choice easier is when you want to use aggregate function like sum, min, max, etcetera and complex queries (like in the financial system mentioned above) then a relational database is probably more convenient then a nosql database since both are not possible on a nosql databse unless you use really a lot of Inverted indexes. When you do use nosql you would have to do the aggregate functions in code or store them seperatly in its own columnfamily but this makes it all quite complex and reduces the performance that you gained by using nosql.
其他回答
除了这里的其他答案之外,沉重的单个查询与无数的轻查询负载是另一个需要考虑的问题。在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可以并行多个查询,但不太擅长优化单个查询。
Mongodb有非常强大的聚合函数和一个富有表现力的聚合框架。它具有许多开发人员习惯于从关系数据库世界中使用的特性。例如,它的文档数据/存储结构允许比Cassandra更复杂的数据模型。
当然,所有这些都是有代价的。因此,当您选择数据库(NoSQL、NewSQL或RDBMS)时,请考虑您要解决的问题和可伸缩性需求。没有一个数据库可以完成所有的工作。
在部署Cassandra的过程中与某人交谈,它不能很好地处理多对多。他们正在做初步测试。我和Cassandra的顾问谈过这个问题,他说如果你有这样的习题集,他就不建议你这么做。
在这里,我将重点介绍一些重要的方面,这些方面可以帮助你决定是否真的需要卡桑德拉。这个清单并不详尽,只是我脑海中最重要的一些观点
Don't consider Cassandra as the first choice when you have a strict requirement on the relationship (across your dataset). Cassandra by default is AP system (of CAP). But, it supports tunable consistency which means it can be configured to support as CP as well. So don't ignore it just because you read somewhere that it's AP and you are looking for CP systems. Cassandra is more accurately termed “tuneably consistent,” which means it allows you to easily decide the level of consistency you require, in balance with the level of availability. Don't use Cassandra if your scale is not much or if you can deal with a non-distributed DB. Think harder if your team thinks that all your problems will be solved if you use distributed DBs like Cassandra. To start with these DBs is very simple as it comes with many defaults but optimizing and mastering it for solving a specific problem would require a good (if not a lot) amount of engineering effort. Cassandra is column-oriented but at the same time each row also has a unique key. So, it might be helpful to think of it as an indexed, row-oriented store. You can even use it as a document store. Cassandra doesn't force you to define the fields beforehand. So, if you are in a startup mode or your features are evolving (as in agile) - Cassandra embraces it. So better, first think about queries and then think about data to answer them. Cassandra is optimized for really high throughput on writes. If your use case is read-heavy (like cache) then Cassandra might not be an ideal choice.
another situation that makes the choice easier is when you want to use aggregate function like sum, min, max, etcetera and complex queries (like in the financial system mentioned above) then a relational database is probably more convenient then a nosql database since both are not possible on a nosql databse unless you use really a lot of Inverted indexes. When you do use nosql you would have to do the aggregate functions in code or store them seperatly in its own columnfamily but this makes it all quite complex and reduces the performance that you gained by using nosql.