Hello Friends, Is there any better alternative for UUID? Can you please provide me a link. Thanks Abhis -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=.
Alternative to what? If you need ideas, take a look at how Authlogic generates them in the Authlogic::Random module. Darian Shimy -- http://www.darianshimy.com http://twitter.com/dshimy On Wed, Nov 18, 2009 at 10:39 PM, Abhishek shukla <betterabhi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hello Friends, > Is there any better alternative for UUID? Can you please provide me a link. > > Thanks > Abhis > > -- > > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=. >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=.
Hello Darian, Thanks for your reply, Basically for generating Primary Key which is not just an auto increment. thanks abhis On Thu, Nov 19, 2009 at 12:18 PM, Darian Shimy <dshimy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Alternative to what? If you need ideas, take a look at how Authlogic > generates them in the Authlogic::Random module. > > Darian Shimy > -- > http://www.darianshimy.com > http://twitter.com/dshimy > > > > On Wed, Nov 18, 2009 at 10:39 PM, Abhishek shukla <betterabhi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > > Hello Friends, > > Is there any better alternative for UUID? Can you please provide me a > link. > > > > Thanks > > Abhis > > > > -- > > > > You received this message because you are subscribed to the Google Groups > > "Ruby on Rails: Talk" group. > > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To unsubscribe from this group, send email to > > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > > For more options, visit this group at > > http://groups.google.com/group/rubyonrails-talk?hl=. > > > > -- > > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=. > > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=.
I would like to extend this discussion somewhat as I don''t see any guarantee that the id generated by "the authlogic method" will in fact meet the requirement placed on that generated by uuid. The UUID (Universally Unique IDentifier) has it''s primary requirement spelled out in the name. The provided id is meant to be unique across multiple platforms without requiring any interplatform syncronization. At it''s base, authlogic provides an identifier (session key) which is a random number. The random number source has evolved over time with the current (inside RoR) technique provided in Ruby 1.9 being SecureRandom. Rails 2.3.4 also provides ActiveSupport::SecureRandom which provides equivalent functionality and defaults to Ruby1.9 if present. SecureRandom will use, preferentially: ossl library random_bytes() /dev/urandom Window''s CryptGenRandom My problem is that I cannot find any guarantee that SecureRandom will provide a value that meets the UUID requirement. Can anyone see what I''m missing here? On Nov 19, 2:28 am, Abhishek shukla <bettera...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hello Darian, > Thanks for your reply, Basically for generating Primary Key which is not > just an auto increment. > > thanks > abhis > > On Thu, Nov 19, 2009 at 12:18 PM, Darian Shimy <dsh...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Alternative to what? If you need ideas, take a look at how Authlogic > > generates them in the Authlogic::Random module. > > > Darian Shimy > > -- > >http://www.darianshimy.com > >http://twitter.com/dshimy > > > On Wed, Nov 18, 2009 at 10:39 PM, Abhishek shukla <bettera...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > wrote: > > > Hello Friends, > > > Is there any better alternative for UUID? Can you please provide me a > > link. > > > > Thanks > > > Abhis > > > > -- > > > > You received this message because you are subscribed to the Google Groups > > > "Ruby on Rails: Talk" group. > > > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh4Ykp1iOSErHA@public.gmane.orgm. > > > To unsubscribe from this group, send email to > > > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > > . > > > For more options, visit this group at > > >http://groups.google.com/group/rubyonrails-talk?hl=. > > > -- > > > You received this message because you are subscribed to the Google Groups > > "Ruby on Rails: Talk" group. > > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To unsubscribe from this group, send email to > > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > > . > > For more options, visit this group at > >http://groups.google.com/group/rubyonrails-talk?hl=.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=.
Hi Abhishek You could override the rails defaults of autoincrementing with following create_table(table_name,:id => false) do |t| t.integer :id,:options => ''PRIMARY KEY'' end Force fully in your controller you should pass the value to :id . Hope this helps , Srinivas Iyer http://talkonsomething.com On Thu, Nov 19, 2009 at 8:43 PM, Rick <richard.t.lloyd-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I would like to extend this discussion somewhat as I don''t see any > guarantee that the id generated by "the authlogic method" will in fact > meet the requirement placed on that generated by uuid. > > The UUID (Universally Unique IDentifier) has it''s primary requirement > spelled out in the name. The provided id is meant to be unique across > multiple platforms without requiring any interplatform syncronization. > > At it''s base, authlogic provides an identifier (session key) which is > a random number. The random number source has evolved over time with > the current (inside RoR) technique provided in Ruby 1.9 being > SecureRandom. Rails 2.3.4 also provides ActiveSupport::SecureRandom > which provides equivalent functionality and defaults to Ruby1.9 if > present. > > SecureRandom will use, preferentially: > ossl library random_bytes() > /dev/urandom > Window''s CryptGenRandom > > My problem is that I cannot find any guarantee that SecureRandom will > provide a value that meets the UUID requirement. Can anyone see what > I''m missing here? > > > On Nov 19, 2:28 am, Abhishek shukla <bettera...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Hello Darian, > > Thanks for your reply, Basically for generating Primary Key which is not > > just an auto increment. > > > > thanks > > abhis > > > > On Thu, Nov 19, 2009 at 12:18 PM, Darian Shimy <dsh...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Alternative to what? If you need ideas, take a look at how Authlogic > > > generates them in the Authlogic::Random module. > > > > > Darian Shimy > > > -- > > >http://www.darianshimy.com > > >http://twitter.com/dshimy > > > > > On Wed, Nov 18, 2009 at 10:39 PM, Abhishek shukla < > bettera...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > > wrote: > > > > Hello Friends, > > > > Is there any better alternative for UUID? Can you please provide me a > > > link. > > > > > > Thanks > > > > Abhis > > > > > > -- > > > > > > You received this message because you are subscribed to the Google > Groups > > > > "Ruby on Rails: Talk" group. > > > > To post to this group, send email to > rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > > > To unsubscribe from this group, send email to > > > > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > <rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%252Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > > > > > . > > > > For more options, visit this group at > > > >http://groups.google.com/group/rubyonrails-talk?hl=. > > > > > -- > > > > > You received this message because you are subscribed to the Google > Groups > > > "Ruby on Rails: Talk" group. > > > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > . > > > To unsubscribe from this group, send email to > > > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > <rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%252Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > > > > > . > > > For more options, visit this group at > > >http://groups.google.com/group/rubyonrails-talk?hl=. > > -- > > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=. > > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=.
Hey Rick, Yes Even I am looking out for some different solution for storing unique ID as a primary key instead of UUID as it stored a 36 character string. You can find more detail on http://www.mysqlperformanceblog.com/2007/03/13/to-uuid-or-not-to-uuid/ Thanks Abhishek Shukla On Fri, Nov 20, 2009 at 5:56 PM, Srinivas Iyer <srimviyer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi Abhishek > > You could override the rails defaults of autoincrementing with following > > create_table(table_name,:id => false) do |t| > t.integer :id,:options => ''PRIMARY KEY'' > end > > Force fully in your controller you should pass the value to :id . > > Hope this helps , > > Srinivas Iyer > http://talkonsomething.com > > > On Thu, Nov 19, 2009 at 8:43 PM, Rick <richard.t.lloyd-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> I would like to extend this discussion somewhat as I don''t see any >> guarantee that the id generated by "the authlogic method" will in fact >> meet the requirement placed on that generated by uuid. >> >> The UUID (Universally Unique IDentifier) has it''s primary requirement >> spelled out in the name. The provided id is meant to be unique across >> multiple platforms without requiring any interplatform syncronization. >> >> At it''s base, authlogic provides an identifier (session key) which is >> a random number. The random number source has evolved over time with >> the current (inside RoR) technique provided in Ruby 1.9 being >> SecureRandom. Rails 2.3.4 also provides ActiveSupport::SecureRandom >> which provides equivalent functionality and defaults to Ruby1.9 if >> present. >> >> SecureRandom will use, preferentially: >> ossl library random_bytes() >> /dev/urandom >> Window''s CryptGenRandom >> >> My problem is that I cannot find any guarantee that SecureRandom will >> provide a value that meets the UUID requirement. Can anyone see what >> I''m missing here? >> >> >> On Nov 19, 2:28 am, Abhishek shukla <bettera...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> > Hello Darian, >> > Thanks for your reply, Basically for generating Primary Key which is not >> > just an auto increment. >> > >> > thanks >> > abhis >> > >> > On Thu, Nov 19, 2009 at 12:18 PM, Darian Shimy <dsh...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> >> wrote: >> > > Alternative to what? If you need ideas, take a look at how Authlogic >> > > generates them in the Authlogic::Random module. >> > >> > > Darian Shimy >> > > -- >> > >http://www.darianshimy.com >> > >http://twitter.com/dshimy >> > >> > > On Wed, Nov 18, 2009 at 10:39 PM, Abhishek shukla < >> bettera...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> >> > > wrote: >> > > > Hello Friends, >> > > > Is there any better alternative for UUID? Can you please provide me >> a >> > > link. >> > >> > > > Thanks >> > > > Abhis >> > >> > > > -- >> > >> > > > You received this message because you are subscribed to the Google >> Groups >> > > > "Ruby on Rails: Talk" group. >> > > > To post to this group, send email to >> rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> > > > To unsubscribe from this group, send email to >> > > > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> >> <rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%252Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> >> > >> > > . >> > > > For more options, visit this group at >> > > >http://groups.google.com/group/rubyonrails-talk?hl=. >> > >> > > -- >> > >> > > You received this message because you are subscribed to the Google >> Groups >> > > "Ruby on Rails: Talk" group. >> > > To post to this group, send email to >> rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> > > To unsubscribe from this group, send email to >> > > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> >> <rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%252Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> >> > >> > > . >> > > For more options, visit this group at >> > >http://groups.google.com/group/rubyonrails-talk?hl=. >> >> -- >> >> You received this message because you are subscribed to the Google Groups >> "Ruby on Rails: Talk" group. >> To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To unsubscribe from this group, send email to >> rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> >> . >> For more options, visit this group at >> http://groups.google.com/group/rubyonrails-talk?hl=. >> >> >> > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=. >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=.