are writes always faster than reads in Cassandra?
Asked Answered
S

1

9

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?

Sousaphone answered 3/8, 2014 at 8:32 Comment(0)
C
11

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

Checkerwork answered 3/8, 2014 at 10:57 Comment(3)
write requires acknowledgments from replicas before it returns successfully to clients..that will make write slower correct?Sousaphone
both writes and reads, if made in CL > 1, requires info from replicas.Checkerwork
I have a 18 node cassandra cluster and we have faster readtimes than write times. As we produce write successful event, consumer of data reads the data immediately( at least 95% of times) and we realized faster reads as presumably data is still in memtables.Girt

© 2022 - 2024 — McMap. All rights reserved.