总是比Cassandra中的读取速度快吗? [英] are writes always faster than reads in Cassandra?

查看:109
本文介绍了总是比Cassandra中的读取速度快吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在听有关Cassandra中数据建模的此话题。发言者通常说写比在Cassandra中读更快。

I was listening to this talk on Data modelling in Cassandra. The speakers makes the general statement that 'writes are faster than reads in Cassandra'.

这种情况是否总是正确的?

Is this case always true? if so why?

推荐答案

这仍然是正确的,尽管与过去相比并没有太大的区别。通常,写操作会更好,因为它不会涉及太多的I / O -当数据已同时提交到提交日志(文件)和内存(内存)中时,写操作就完成了。当memtable达到最大大小时,所有表都将刷新到sstable磁盘中。不同地,由于不同的原因,读取可能需要更多的I / O。读取操作首先涉及从Bloom过滤器(与sstable关联的过滤器,可以节省I / O时间,表明关联的sstable中肯定没有数据)中读取数据,然后,如果过滤器返回正值,Cassandra开始寻找稳定查找数据。 HTH,卡洛

That's still true even though is not a big difference like in past. A write in general perform better because it doesn't involve too much the I/O -- a write operation is completed when the data has been both written in the commit log (file) and in memory (memtable). When the memtable reach the max size then all table is flushed in a disk sstable. Differently a read may require more I/O for different reasons. A read operation first involve reading from a bloom filter (a filter associated to sstable that might save I/O time saying that a data is surely not present in the associated sstable) and then, if filter returns a positive value, Cassandra starts seeking the sstable to look for data. HTH, Carlo

这篇关于总是比Cassandra中的读取速度快吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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