Cassandra uuid or text with uuid from Java

cassandracassandra-2.0datastaxspring-data-cassandra

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

Best Answer

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.

Related Topic