1

Can you please help me understand the difference between Cassandra UUID vs TimeUUID data type values ?

Many Thanks

Community
  • 1
  • 1
user3780030
  • 81
  • 2
  • 8

2 Answers2

1

The Cassandra Docs have an explanation of the difference between the two types.

The key difference is,

A value of the timeuuid type is a Type 1 UUID. A type 1 UUID includes the time of its generation and are sorted by timestamp...

It is easy to think of a UUID as a randomly generated unique key and a TIMEUUID as a randomly generated unique key with a timestamp embedded within making sorting possible.

Nathan
  • 3,082
  • 1
  • 27
  • 42
0

The timeuuid cassandra type is a type 1 uuid, which is composed of a date-time, MAC address, and sequence number. If generated from the same location, they will be monotonically increasing, hence somewhat compressible when you compress many.

The uuid cassandra type is a type 4 uuid, which is just a huge random number. It is not monotonic or compressible.

Everything is detailed there https://en.wikipedia.org/wiki/Universally_unique_identifier

lacroix1547
  • 1,060
  • 1
  • 8
  • 16