对Cassandra术语感到困惑(行与分区) [英] Confused on Cassandra terminology (row vs partition)

查看:54
本文介绍了对Cassandra术语感到困惑(行与分区)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望有人能消除我对Cassandra中行和分区之间区别的困惑。我认为一行将是一组列(如在SQL DB中一样),如模式中所指定的那样,它们按分区键分布在节点上,并按每个分区内的聚类键排序。



但是随后我遇到了本教程:



我的阅读是,这显示了一个具有两行的分区。在我看来,无论您插入多少 new 数据,分区都会增长,但行不会增长(当然,缺少运行 alter table)?

解决方案

您是正确的。在您发表的文章中,他谈到的是分区,而不是行。



在许多情况下,这两个术语仍然非常松散地使用。早在节俭的日子里,正确的术语是行,但是随着新的CQL而改变。



在节俭的不相关笔记中,您可以增长一行(而不是分区)因为每一行都有自己的架构。您可以在此处找到更多信息:
http://www.datastax.com/dev/blog/does-cql-support-dynamic-columns-wide-rows


I am hoping someone can clear my confusion on the difference between a row and partition in Cassandra. I thought a row would be a set of columns(like in a SQL DB), as specified in the schema, distributed across nodes by partition keys and ordered by the clustering key within each partition.

But then I ran into this tutorial: https://academy.datastax.com/demos/getting-started-time-series-data-modeling

Under "Time series Pattern 1", it states:

Since each column is dynamic, our row will grow as needed to accommodate the data.

Why would a row grow? I can see a partition growing but why a row? The picture in that example also makes no sense to me -- I imagine the partition as being a set of rows each having a (WeatherStation|event) columns, where WeatherStationID would be same repeated value for each row in a partition.

I also tried looking at this tutorial: http://www.slideshare.net/yukim/cql3-in-depth, slide 15.

My reading is that this shows a single partition with two rows. It seems to me that no matter how much new data you insert, the partition will grow but not the row (short of running "alter table" of course)?

解决方案

You are correct. In the article that you posted he talks of partitions, not rows.

The two terms are still used very loosely to mean each other in many situations. Back in the thrift days, the correct term was row but that changed with the new CQL.

On a unrelated note in Thrift you are able grow a row(not partition) since every row had their own Schema. You can find more information on that here: http://www.datastax.com/dev/blog/does-cql-support-dynamic-columns-wide-rows

这篇关于对Cassandra术语感到困惑(行与分区)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆