Cassandra - 合理的最大表数是多少? [英] Cassandra - What is the reasonable maximum number of tables?

查看:37
本文介绍了Cassandra - 合理的最大表数是多少?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 Cassandra 的新手.据我了解,每个键空间可以存储的最大表数是 Integer.Max_Value.但是,从如此大量的表的性能角度(速度、存储等)来看,这意味着什么?对此有什么建议吗?

I am new to Cassandra. As I understand the maximum number of tables that can be stored per keyspace is Integer.Max_Value. However, what are the implications from the performance perspective (speed, storage, etc) of such a big number of tables? Is there any recommendation regarding that?

推荐答案

虽然在 Cassandra 中有大量表的合法用例,但它们很少见.您的用例可能是其中之一,但请确保它是.如果不了解更多有关您要解决的问题的信息,显然很难提供指导.显然,许多表将需要更多资源.多少?这取决于设置和使用情况.

While there are legitimate use cases for having lots of tables in Cassandra, they are rare. Your use case might be one of them, but make sure that it is. Without knowning more about the problem you're trying to solve, it's obviously hard to give guidance. Many tables will require more resources, obviously. How much? That depends on the settings, and the usage.

例如,如果您有一千个表并同时写入所有这些表,则会出现 RAM 争用,因为每个表都有内存表,并且每个内存表都有一定的开销(多少取决于 Cassandra 的版本、您的设置等).

For example, if you have a thousand tables and write to all of them at the same time there will be contention for RAM since there will be memtables for each of them, and there is a certain overhead for each memtable (how much depends on which version of Cassandra, your settings, etc.).

但是,如果您有一千个表但不同时写入所有表,则争用会减少.每个表仍然有一个开销,但会有更多的 RAM 来保持活动表的内存表.

However, if you have a thousand tables but don't write to all of them at the same time, there will be less contention. There's still a per table overhead, but there will be more RAM to keep the active table's memtables around.

磁盘 IO 也是如此.如果您同时读取和写入许多不同的表,磁盘将执行更多的随机 IO.

The same goes for disk IO. If you read and write to a lot of different tables at the same time the disk is going to do much more random IO.

拥有很多表并不是什么大问题,即使您可以拥有的数量是有限的——只要您有足够的 RAM 来保持跟踪它们的结构,您就可以拥有任意数量的表.但是,拥有大量表格并同时读取和写入它们将是一个问题.与对更少的表进行相同数量的读取和写入相比,它需要更多的资源.

Just having lots of tables isn't a big problem, even though there is a limit to how many you can have – you can have as many as you want provided you have enough RAM to keep the structures that keep track of them. Having lots of tables and reading and writing to them all at the same time will be a problem, though. It will require more resources than doing the same number of reads and writes to fewer tables.

这篇关于Cassandra - 合理的最大表数是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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