Ligo George
Ligo George

Reputation: 889

What is the difference between INT and VARINT in Cassandra Datatypes?

Can someone please explain the difference between INT and VARINT data types in Cassandra. When should I use VARINT and what are its advantages ?

Upvotes: 5

Views: 5052

Answers (2)

jq170727
jq170727

Reputation: 14635

As mentioned in the answer

and described in the Cassandra documentation, int is a 32-bit integer whereas varint is an arbitrary-precision integer implemented by java.math.BigInteger. As such int will be smaller and faster compared to varint but limited in its range.

java.math.BigInteger has been discussed previously in these stack overflow questions:

Upvotes: 5

Alexander Gauthier
Alexander Gauthier

Reputation: 1

int is final.... varint is not. Like static in C/C++/java

Upvotes: -3

Related Questions