cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aklin_81 <asdk...@gmail.com>
Subject Re: Using a synchronized counter that keeps track of no of users on the application & using it to allot UserIds/ keys to the new users after sign up
Date Fri, 04 Feb 2011 05:12:39 GMT
Thanks Matthew & Ryan,

The main inspiration behind me trying to generate Ids in sequential
manner is to reduce the size of the userId, since I am using it for
heavy denormalization. UUIDs are 16 bytes long, but I can also have a
unique Id in just 4 bytes, and since this is just a one time process
when the user signs-up, it makes sense to try cutting down the space
requirements, if it is feasible "without any downsides"(!?).

I am also using userIds to attach to Id of the other data of the user
on my application. If I could reduce the userId size that I can also
reduce the size of other Ids, I could drastically cut down the space
requirements.


[Sorry for this question is not directly related to cassandra but I
think Cassandra factors here because of its  tuneable consistency]

Regards
Asil


On Fri, Feb 4, 2011 at 1:09 AM, Ryan King <ryan@twitter.com> wrote:
> You could also consider snowflake:
>
> http://github.com/twitter/snowflake
>
> which gives you ids that roughly sort by time (but aren't sequential).
>
> -ryan
>
> On Thu, Feb 3, 2011 at 11:13 AM, Matthew E. Kennedy
> <matt.kennedy@spadac.com> wrote:
>> Unless you need your user identifiers to be sequential for some reason, I would save
yourself the headache of this kind of complexity and just use UUIDs if you have to generate
an identifier.
>>
>> On Feb 3, 2011, at 2:03 PM, Aklin_81 wrote:
>>
>>> Hi all,
>>> To generate new keys/ UserIds for new users on my application, I am
>>> thinking of using a simple synchronized counter that can keep track of
>>> the no. of users registered on my application and when a new user
>>> signs up, he can be allotted the next available id.
>>>
>>> Since Cassandra is eventually consistent, Is this advisable to
>>> implement with Cassandra, but then I could also use stronger
>>> consistency level like quorum or all for this purpose.
>>>
>>>
>>> Please let me know your thoughts and suggesttions..
>>>
>>> Regards
>>> Asil
>>
>>
>
>
>
> --
> @rk
>

Mime
View raw message