Re: Data modeling users table with CQL

2014-01-21 Thread Drew Kutcharian
A shameful bump ;) On Jan 20, 2014, at 2:14 PM, Drew Kutcharian d...@venarc.com wrote: Hey Guys, I’m new to CQL (but have been using C* for a while now). What would be the best way to model a users table using CQL/Cassandra 2.0 Lightweight Transactions where we would like to have: - A

Re: Data modeling users table with CQL

2014-01-21 Thread Tupshin Harper
One CQL row per user, keyed off of the UUID. Another table keyed off of email, with another column containing the UUID for lookups in the first table. Only registration will require a lightweight transaction, and only for the purpose of avoiding duplicate email registration race conditions.

Re: Data modeling users table with CQL

2014-01-21 Thread Drew Kutcharian
Thanks, I was actually thinking of doing that. Something along the lines of CREATE TABLE user ( idtimeuuid PRIMARY KEY, emailtext, nametext, ... ); CREATE TABLE user_email_index ( email text, id timeuuid, PRIMARY KEY (email, id) ); And during registration, I would

Re: Data modeling users table with CQL

2014-01-21 Thread Tupshin Harper
It does sound right. You might want to have additional session tracking id's, separate from the user id, but that is an additional implementation detail, and could be external to Cassandra. But the approach you describe accurately describes what I would do as a first pass, at least. -Tupshin

Re: Data modeling users table with CQL

2014-01-21 Thread Drew Kutcharian
Cool. BTW, what do you mean by have additional session tracking ids? What’d that be for? - Drew On Jan 21, 2014, at 10:48 AM, Tupshin Harper tups...@tupshin.com wrote: It does sound right. You might want to have additional session tracking id's, separate from the user id, but that is

Re: Data modeling users table with CQL

2014-01-21 Thread Jon Ribbens
On Tue, Jan 21, 2014 at 10:40:39AM -0800, Drew Kutcharian wrote: Thanks, I was actually thinking of doing that. Something along the lines of CREATE TABLE user ( idtimeuuid PRIMARY KEY, emailtext, nametext, ... ); CREATE TABLE user_email_index

Re: Data modeling users table with CQL

2014-01-21 Thread Drew Kutcharian
You’re right. I didn’t catch that. No need to have email in the PRIMARY KEY. On Jan 21, 2014, at 5:11 PM, Jon Ribbens jon-cassan...@unequivocal.co.uk wrote: On Tue, Jan 21, 2014 at 10:40:39AM -0800, Drew Kutcharian wrote: Thanks, I was actually thinking of doing that. Something along the

Data modeling users table with CQL

2014-01-20 Thread Drew Kutcharian
Hey Guys, I’m new to CQL (but have been using C* for a while now). What would be the best way to model a users table using CQL/Cassandra 2.0 Lightweight Transactions where we would like to have: - A unique TimeUUID as the primary key of the user - A unique email address used for logging in In