问题描述
好吧,NoSQL是一个时髦词,所以我一直在研究它。我还没有弄清楚ColumnFamilies和SuperColumns等等...但是我一直在看着数据是如何映射的。
Well, NoSQL is a buzzword right now so I've been looking into it. I'm yet to get my head around ColumnFamilies and SuperColumns, etc... But I have been looking at how the data is mapped.
After reading this article, and others, it seems the data is mapped in a JSON like format.
Users = {
1: {
username: "dave",
password: "blahblah",
dateReged: "1/1/1"
},
2: {
username: "etc",
password: "blahblah",
dateReged: "2/1/1",
comment: "this guy has a comment and dave doesns't"
},
}
RDBMS格式为:
Table name: "Users"
id | username | password | dateReged | comment
---+----------+----------+-----------+--------
1 | dave | blahblah | 1/1/1 |
---+----------+----------+-----------+--------
2 | etc | blahblah | 2/1/1 | this guy has a comment and dave doesn't
假设我正确理解了这一点, ,为什么我会选择RDBMS设计的NoSQL设计?就我个人而言,我更愿意使用JSON结构...这是否意味着我应该选择NoSQL,比如说MySQL?
Assuming I understand this correctly and my above examples are right, why would I choose the RDBMS design over the NoSQL design? Personally, I'd much rather work with the JSON structure... Does this mean I should choose NoSQL over, say, MySQL?
我猜我在问什么是我应该在什么时候选择NoSQL over RDBMS?
I guess what I'm asking is "when should I choose NoSQL over RDBMS?"
另一方面,正如我所说,我还是不完全理解如何实现Cassandra数据库。即,如何在新数据库中创建上述用户表?任何教程,文档等,你可以指向是伟大的。我的google'ing在'从头开始'方面没有太大的变化...
On a side note, as I've said, I'm still not fully understanding how to go about implementing a Cassandra database. Ie, how do I create the above Users table in a new database? Any tutorials, documentation, etc you could point to would be great. My google'ing hasn't turned up much in terms of 'starting from scratch'...
推荐答案
NoSQL是水平可扩展性和分布式存储。这意味着你可以有大量的集群节点并且并行写入它们。集群将确保最终将更改传播到其他集群节点(最终一致性)。
The main advantage of NoSQL is horizontal scalability and distributed storage. That means you can have a large number of 'cluster nodes' and write to them in parallel. The cluster will ensure changes are propagated to the other cluster nodes eventually (eventual consistency).
NoSQL不是关于SQL(该术语意味着不仅仅是SQL) 。事实上,一些NoSQL产品确实支持SQL的一个子集。数据格式不同(JSON或属性/值对与表格数据的列表)的原因是:在关系数据库中,列数(和列名称)的数量被定义在中心位置,这不适用于水平可扩展性(您需要停止所有集群节点的模式更改)。此外,连接不受支持,因为这将打破水平可扩展性(如果数据是分布式的,则可能需要读取来自多个集群节点的数据)。
NoSQL is not so much about SQL (the term means "not only SQL"). In fact, some NoSQL products do support a subset of SQL. The reason the data format is different (JSON or list of property / value pairs versus tabular data) is: within relational databases, the number of columns (and column names) is defined in a central place, which doesn't work well with horizontal scalability (you would need to stop all cluster nodes for schema changes). Also, joins are not supported as much because that would break horizontal scalability (data from multiple cluster nodes may need to be read, if the data is distributed).
这篇关于什么使Cassandra(和一般的NoSQL)一个更好的解决方案RDBMS?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!