0

Both MyRocks (MySql) and Cassandra uses LSM architecture to store their data. So I have populated around 5 million rows in MySql with MyRocks as storage engine and also in Cassandra. In Cassandra it takes only 1.7 GB of disk space while in MySql with MyRocks as storage engine, takes 19 GB.

Am I missing something? Both uses same LSM mechanism. But why they differ in data size? Can someone please explain?


And an update to the above question. I guess it has something to do with the text column.

  • Tried with another Table Structure : (bigint,bigint,varchar,text).
  • No Of rows Populated : 300 000
  • Now in MyRocks the data size is 185MB
  • In Cassandra - 13 MB.

But if I remove the text column then,

  • MyRocks - 21.6 MB
  • Cassandra - 11 MB

Any idea about this behaviour?

  • Let's see the table definition in each. Why does your app prefer LSM instead of directly augmenting the table(s)? (You gotta pay the piper sooner or later!) – Rick James Nov 2 '17 at 14:45
  • Table Structure : (id bigint,value varchar(255),flag int,textcol1 text,textcol2 text,textcol3 text, primary key(id,value)) – Aravind Tyson Nov 3 '17 at 7:56
  • "... if I remove the text column ..." (implying "the only") -- but I see 3 text columns?? – Rick James Nov 3 '17 at 21:20
1

Well the reason for the above behaviour is due to the rocksdb_block_size set to 4kb. Due to smaller data blacks the compressor finds lesser amount of data to compress. Setting it to 16kb solved the issue. Now I get the similar data size as of cassandra.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.