cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kevin" <thebachel...@gmail.com>
Subject RE: When does it make sense to use TimeUUID?
Date Wed, 15 Jun 2011 00:41:31 GMT
TimeUUIDs should be used for data that is time-based and requires
uniqueness.

 

TimeUUID comparisons compare the time-based portion of the UUID. So no, you
do not need to know the MAC addresses. In fact, for languages that cannot
get to that low of a level to access a MAC address (like Java), the timeUUID
tools generate random data for that part of the UUID.

 

I don't understand your "user1"/"user2" scenario. The timeUUIDs in that
scenario wouldn't even come in to question because the columns would be in
two different rows since they pertain to two different users (unless they
are referencing some other Column Family where those same TimeUUIDs are rows
or columns in the same row).

 

A good example of something that timeUUIDs would be great for would be
friend requests. Regular time-based strings would not be sufficient in this
case since it's possible that two requests can be sent from two different
computers at the same time. Thus, you can store the requests as columns (or
super columns) each named by a timeUUID. Later (assuming you've chosen to
let Cassandra sort the columns or supercolumns by timeUUID), you can fetch
all the requests for a given user in either most-recent, or least-recent
order.  

From: Sameer Farooqui [mailto:cassandralabs@gmail.com] 
Sent: Tuesday, June 14, 2011 8:16 PM
To: user@cassandra.apache.org
Subject: When does it make sense to use TimeUUID?

 

I would like to store some timestamped user info in a Column Family with the
usernames as the row key and different timestamps as column names. Each user
might have a thousand timestamped data.

 

I understand that the ver 1 UUIDs that Cassandra combines the MAC address of
the computer generating the UUID with the number of 100-nanosecond intervals
since the beginning of the Gregorian calendar.

 

So, if user1 had data stored for an event at Jan 30, 2011/2:15pm and user2
had an event at the exact same time, the data could potentially be stored in
different column names? So, I would have to know the MAC of the generating
computer in order to do a column slice, right? 

 

When does it make sense to use TimeUUID vs just a time string like
20110130141500 and comparator type UTF8?

 

- Sameer


Mime
View raw message