Reputation: 889
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
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
Reputation: 1
int is final.... varint is not. Like static in C/C++/java
Upvotes: -3