Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cassandra uuid or text with uuid from Java

I was thinking, instead of creating Cassandra table with uuid column if I create a text column , at the end I am going to insert in it Java.util.uuid.random string. So what will be the difference performance wise if I use text in place of Cassandra unidirectional

like image 883
Rohit Kasat Avatar asked Dec 20 '22 00:12

Rohit Kasat


1 Answers

Storing a UUID as a text field would probably use a lot more storage space. A UUID is encoded with 16 bytes, but as a string it would use considerably more.

In addition to using more storage space, it would probably slow down operation somewhat since you are reading and writing more data, and if it is part of the partition key, there would be some additional overhead of calculating the token hash from a long string versus the UUID.

like image 91
Jim Meyer Avatar answered Jan 03 '23 00:01

Jim Meyer