incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Shuler <>
Subject Re: Cassandra Data Model and Surrogate Keys
Date Tue, 25 Feb 2014 03:16:42 GMT
On 02/24/2014 09:00 PM, John Stager wrote:
> Hello,
> We are working on our data model for Cassandra and we have a need to use
> surrogate keys (timeuuid) and not the natural key for one of our tables
> but this causes a possible timing issue when determining if a row
> already exists.Are there any best practices or patterns for Cassandra
> for using surrogate keys?
> This is the classic user id (surrogate key) and username (email address).

This sounds like the perfect use case for lightweight transactions and 
just using timeuuid. LWT are more expensive due to read before write, 
but when needed, as in your case, it's the right fit. Even with 
perfectly time-synced nodes, there is still a race for two users to 
create the same userid, which is why LWT was included.

Kind regards,

View raw message